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. ?
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.
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.
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.
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.
By default the dispatcher provided by Akka
is one with a fork-join-executor
, and the default parallelism values are these:
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 } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With