This is a pretty tricky question.
The configuration of the dispatchers really depends on the type of work of your actors.
You should probably look at the actors who generate the futures to do their job. It might be a good idea to predefine the execution context in the configuration file and use them as follows:
implicit val ec : ExecutionContext = context.system.dispatchers.lookup("someDispatcher")
these actors are likely to cause a starvation effect.
The effect you want to achieve is to make sure that messages are processed quickly, and long-term work does not affect them, so separation is the key here.
A good tool to monitor your application is the Configure Console . You can look at the dispatcher there and see that the delay in processing messages increases.
Another issue is identifying participants who are at high risk, such as network I / O. If something happens that the thread is again unavailable in the pool, this will create problems.
It is very likely that without experimenting with threadpool size, you will not know what works best for you.
Most of the tips I wrote I know from Effective Akka by Jamie Allen and they seem to work well for me. This book has a Fixing Starvation section. You can look at her closer.
source share