val workers = system.actorOf(Props[Worker].withRouter(RoundRobinRouter(4)).withDispatcher("worker-dispatcher"), "worker")
worker-dispatcher {type = BalancingDispatcher}
As the actors in the BalancingDispatcher will share the mailbox, the
router here is redundant :)
-----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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
a) It is not necessary to have a router as all the actors configured
with the given BalancingDispatcher will share the mailbox. Excerpt
from doc: "i.e. the actors belong to a pool of actors, and to the
client there is no guarantee about which actor instance actually
processes a given message.".
b) I think not. BalancingDispatcher is a very strange one, and needs
some care when used.
If I create my actors by hand, sure. But a router does more than just route
- it also creates actors for me and allows the number of actors created to
be configured from application.conf and/or resized with a resizer. Is there
something that isn't a router that will provide the same functionality and
that can be used with BalancingDispatcher?
I am not sure I understand properly what you mean by "isn't a router
that will provide the same functionality".
On Mon, Jan 21, 2013 at 5:16 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:That is true.
> Also, the original version used to be work-donating instead of work-sharing
> (which it is now).
See the comment I made 10 min ago:
>
> Perhaps time we let it retire?
https://www.assembla.com/spaces/akka/tickets/2927#/activity/ticket:
On Mon, Jan 21, 2013 at 5:25 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:But it was still called WorkStealing*.
>
>
>
> On Mon, Jan 21, 2013 at 5:22 PM, Jonas Bonér <jo...@jonasboner.com> wrote:
>>
>> On Mon, Jan 21, 2013 at 5:16 PM, √iktor Ҡlang <viktor...@gmail.com>
>> wrote:
>> > Also, the original version used to be work-donating instead of
>> > work-sharing
>> > (which it is now).
>>
>> That is true.
SmallestMailboxRouter is *similar* but not the same. Are you suggesting that SmallestMailboxRouter is "close enough"? Or is there something else that I should look at?
--
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
def receive = {case Work(pages) =>for (Page(title, text) <- pages)for (word <- Words(text))counts(word) += 1producer ! RequestWork(batchSize)}
def receive = {case Work(pages) =>producer ! RequestWork(batchSize)for (Page(title, text) <- pages)for (word <- Words(text))counts(word) += 1}
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
what happens if you switch the order here:
Also, in the code, I find it a bit strange that the examples aren't using the exact same logic to perform the actual work. I'd split that out into a trait/parent and mix that in.
On 29 Jan 2013, at 17:57, √iktor Ҡlang <viktor...@gmail.com> wrote:what happens if you switch the order here:Ah - good question. I'll try that and get back to you.
Also, in the code, I find it a bit strange that the examples aren't using the exact same logic to perform the actual work. I'd split that out into a trait/parent and mix that in.I was being lazy, I'll admit - I should have done that. But looking at the code again, I can't see the difference you're referring to?
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Cool. Also, why are you doing "toArray" here: https://github.com/paulbutcher/AkkaProducerConsumerBenchmarks/blob/master/src/main/scala/com/paulbutcher/ProducerPull.scala#L14
On 29 Jan 2013, at 18:15, √iktor Ҡlang <viktor...@gmail.com> wrote:Cool. Also, why are you doing "toArray" here: https://github.com/paulbutcher/AkkaProducerConsumerBenchmarks/blob/master/src/main/scala/com/paulbutcher/ProducerPull.scala#L14Ah - thinking about it, that might have been a misunderstanding about what it means for a message to be invariant. Pages returns an iterator, and so, therefore, does "take". So I was converting to an Array so that the IO had been done before the message was sent. But thinking about it, that might be OK in this case?
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Ah, ok, but FYI Arrays are mutable :-)
On 29 Jan 2013, at 20:03, √iktor Ҡlang <viktor...@gmail.com> wrote:Ah, ok, but FYI Arrays are mutable :-)True - me being lazy again I'm afraid (sorry - I have a bad habit of taking shortcuts in benchmark code that I wouldn't in production code). Mutable, but not in fact mutated by the code as it stands. Whereas consuming an iterator would be mutation - although as I said in my earlier message, perhaps not "bad" mutation in this case?
I'll try running a version with the reordering you suggested, and an iterator in the message, to see how much of the speed difference between the pull and push versions results from these questions.
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
On 29 Jan 2013, at 17:57, √iktor Ҡlang <viktor...@gmail.com> wrote:what happens if you switch the order here:Ah - good question. I'll try that and get back to you.
--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
what "throughput" is configured for the balancing dispatcher? >1 = not fair at all.