well yes, since the size of workload is quite variable, ultimately it comes down to a ratio between the size of the load and the available memory. basically if the ask/await is the recommended way i can compose around this idea.
thanks On Tuesday, February 25, 2014 3:08:32 PM UTC+1, Akka Team wrote: > > Hi Arjun, > > You do not need to wait for every message delivery. You should have a > buffer (say 10) which you remove jobs once they are accepted. You only need > to wait if that buffer is full. > > -Endre > > > On Tue, Feb 25, 2014 at 2:51 PM, Arjun Panday <[email protected]<javascript:> > > wrote: > >> PS: thanks Endre, at least waiting synchronously for the WorkAccepted >> message saves me from the OutOfMemoryError. Although it seems overkill in >> many situations, I'd rather be safe than sorry. >> >> >> On Monday, February 24, 2014 6:04:04 PM UTC+1, Arjun Panday wrote: >>> >>> >>>>> >>>> That is good that you have it, but what I wanted to recommend is an Ack >>>> for receival, you can name it WorkAccepted or something like that. This >>>> helps the central entity to keep track in-flight work requests to relieve >>>> the network. >>>> >>> >>> Thanks for the tip. The dispatcher does remember what was sent to which >>> worker so that it can recover on error. I think this is out of the scope of >>> my issue though. Even with a WorkAccepted message, the work itself would be >>> sent asynchronously, so I would be trying to send more than I can handle >>> before I even get the first WorkAccepted... unless I use some kind of >>> ask/await pattern to wait for the WorkAccepted before I can move on to >>> serve the next worker. Maybe I can try that, but the await seems a bit >>> ugly.. Ideally I would like to parallelize the sends as much as my memory >>> allows.. >>> >>> >>>> >>>>> >>>>> The problem is that at startup, all my workers are ready and they each >>>>> request a piece of (heavy) workload. The dispatcher tries to distribute >>>>> the >>>>> workload to all these workers, and since sending is asynchronous, it ends >>>>> up buffering all these messages being sent, so it runs out of heap before >>>>> the messages can leave the JVM. >>>>> >>>> >>>> At some point, somewhere, someone needs to slow down. You need to >>>> identify which entity overloads the rest of the system. Then you either >>>> throttle back that entity, or eliminate the bottleneck if possible by >>>> scaling out (I don't know if it is possible in your case). >>>> >>> >>> At this point the workers don't do anything with the load, they just >>> acknowledge, so the only bottleneck here is the dispatcher. >>> >>> >>> >>> >>>> >>>> -Endre >>>> >>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Monday, February 24, 2014 5:20:57 PM UTC+1, Akka Team wrote: >>>>> >>>>>> Hi Arjun, >>>>>> >>>>>> The classical pull behavior would be the workers sending requests for >>>>>> new jobs when they are available for work (periodically if needed). Is >>>>>> there a reason why you reversed this relation? >>>>>> >>>>>> >>>>>> My problem is to limit the parallelization of the outgoing messages: >>>>>>> as the number of clients increases, my dispacther is trying to send as >>>>>>> many >>>>>>> workload messages in parallel and I end up with an OutOfMemoryError. >>>>>>> >>>>>> >>>>>> You can use either the throttler from akka-contrib >>>>>> http://doc.akka.io/docs/akka/2.3.0-RC4/contrib/throttle.html >>>>>> #introduction and modify it as you see fit, or you can send >>>>>> acknowledgements from the workers when they successfully received the >>>>>> work >>>>>> (it is good practice anyway!) and stop producing work if there are too >>>>>> many >>>>>> unacknowledged dispatched work. >>>>>> >>>>>> -Endre >>>>>> >>>>>> >>>>>>> >>>>>>> My understanding is that we can configure the "input" mailboxes of >>>>>>> actors, but here there's never more than one item in my recipient's >>>>>>> mailbox, it's the number of recipients that grows, and I want to make >>>>>>> sure >>>>>>> I don't send more than one message at a time (or at least not more than >>>>>>> what my memory can handle!) >>>>>>> >>>>>>> Is there a way ton configure or override this in Akka? >>>>>>> >>>>>>> Thanks, >>>>>>> Arjun >>>>>>> >>>>>>> -- >>>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou >>>>>>> p/akka-user >>>>>>> --- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Akka User List" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To post to this group, send email to [email protected]. >>>>>>> >>>>>>> Visit this group at http://groups.google.com/group/akka-user. >>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Akka Team >>>>>> Typesafe - The software stack for applications that scale >>>>>> Blog: letitcrash.com >>>>>> Twitter: @akkateam >>>>>> >>>>> -- >>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>> >>>>>>>>>> Search the archives: https://groups.google.com/ >>>>> group/akka-user >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Akka User List" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at http://groups.google.com/group/akka-user. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>> >>>> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Akka Team > Typesafe - The software stack for applications that scale > Blog: letitcrash.com > Twitter: @akkateam > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/groups/opt_out.
