cbear
cbear

Reputation: 35

AKKA thread pool configuration

Based on my usecase, I would like to create an Akka Actor per item id. This way each item action is executed by one and one thread/actor but can do concurrent items at the same time. But I have stumbled upon how to configure the number of threads for my system since I may have 1000 of items coming in at the same time and would like to use some max number of threads say 20 to service the 1000 items. Is this possible with Akka.

Thanks, Ravi

Upvotes: 0

Views: 768

Answers (1)

Governa
Governa

Reputation: 908

Based on the Docs, you should try these parameters on your akka config:

# This will be used if you have set "executor = "fork-join-executor""
fork-join-executor {
  # Min number of threads to cap factor-based parallelism number to
  parallelism-min = 8

  # The parallelism factor is used to determine thread pool size using the
  # following formula: ceil(available processors * factor). Resulting size
  # is then bounded by the parallelism-min and parallelism-max values.
  parallelism-factor = 3.0

  # Max number of threads to cap factor-based parallelism number to
  parallelism-max = 64

}

I'm assuming you have not changed your default-executor parameter because if you had you would already know where to look.

Upvotes: 1

Related Questions