multithreading - Akka: how to config Router, dispatcher to make a better performance? -


i have played around akka 2 weeks , still confused basic concept.

i have simple pattern contains 3 kinds of actors:

  • master
  • worker
  • reporter

i config these actors following:

master

master use following dispatcher roundrobinrouter(10):

mailbox-capacity = 10000 executor = "fork-join-executor" fork-join-executor {   parallelism-min = 0   parallelism-max = 600   parallelism-factor = 3.0 } 

worker

i have several workers(ref) in system, receive messages master, , each of them use router of roundrobinrouter(10).

type = dispatcher executor = "fork-join-executor" fork-join-executor {   parallelism-min = 0   parallelism-max = 600   parallelism-factor = 3.0 } mailbox-capacity = 100000 

notifier

is actor used receive result worker, , counting up. uses same dispatcher workers.

i have made adjustment on parallelism parameters , router, performance seems no change. takes 80 seconds consume 10 million tasks, of each takes @ least 500 ms finish.

so got me there, if dispatcher acts thread pool, if actor use dispatcher without using router, means there 1 instance. code in receive block executed parallel?

just in case else in code messed things up: gist

and virtual machine runs program:

  • 32-bit ubuntu 12.04 lts
  • memory 5.0 gib
  • intel® core™ i5-2500 cpu @ 3.30ghz × 4

sorry put question unclear here. if there thing can improve performance please tell me. advise welcome. thank in advance.

update

sorry! 10 million task, not 100 million! bad, sorry!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -