pedroct92 pedroct92 - 3 months ago 62
Java Question

How to limit the number of running tasks on akka scheduler?

I have an application in Java Play Framework and the user can run multiple tasks at the same time and it can take a long time to finish. I thought that I could used the

in order to do that. However, I've made a few tests and found out that the user can run up to 4 tasks at the same time otherwise the tasks would be taking more resources than my server could provide. So Is there a way to limit the number of tasks running at the same time on the Akka scheduler?


If you want to globally limit the concurrent tasks, you could set the akka max pool size to that number. Information about configuration is available here:

Specifically, there is a setting: = 64

which you can set to the maximum number of tasks you want to run concurrently. This is the number of threads that will be used.