Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default Akka dispatcher configuration values?

In the Akka documentation it states that if a dispatcher is not configured a default dispatcher will be used. What are the properties of the default dispatcher i.e parallelism-min, parallelism-factor, parallelism-max etc. ?

like image 958
Tsume Avatar asked Apr 23 '13 17:04

Tsume


People also ask

What are dispatchers in Akka?

Akka is mostly based on ActorSystem and as a result dispatchers are said to be the main engine of an ActorSystem. Hence the saying- dispatchers are what makes Akka “tick”. In Akka, they are responsible for selecting an actor and it's messages and assigning them to the CPU.

Which dispatcher is used for testing purpose in Akka?

By default akka uses default dispatcher “fork-join-executor” if no configuration is defined for custom dispatchers. To set up a dispatchers for your application you have to provide dispatcher configuration in configuration file.

What is parallelism factor?

parallelism-factor defines a factor for calculating number of threads from available processors. The default value is 3. fork-join-executor. parallelism-max defines maximum number of threads fork-join-executor managed ThreadPool can have. The default value is 64.

What is execution context in Akka?

If an ActorSystem is created with an ExecutionContext passed in, this ExecutionContext will be used as the default executor for all dispatchers in this ActorSystem. If no ExecutionContext is given, it will fallback to the executor specified in akka. actor. default-dispatcher.


1 Answers

By default the dispatcher provided by Akka is one with a fork-join-executor, and the default parallelism values are these:

  • parallelism-min: 8
  • parallelism-factor: 3.0
  • parallelism-max: 64

You can see all of this in the documentation.

There is a section named: Listing of the Reference Configuration

Here is the relevant part of the configuration file (I only removed the comments):

default-dispatcher {     type = "Dispatcher"     executor = "fork-join-executor"      fork-join-executor {         parallelism-min = 8         parallelism-factor = 3.0         parallelism-max = 64     }      thread-pool-executor {         keep-alive-time = 60s         core-pool-size-min = 8         core-pool-size-factor = 3.0         core-pool-size-max = 64         max-pool-size-min = 8         max-pool-size-factor  = 3.0         max-pool-size-max = 64         task-queue-size = -1         task-queue-type = "linked"          allow-core-timeout = on     } } 
like image 151
Rodrigo Sasaki Avatar answered Oct 12 '22 15:10

Rodrigo Sasaki