0

We use Playframework 1.x.

We haven't touched thread pool size and we use the default value which (nb processors + 1). Our production server has 4 core processor and I assume 5 threads at a time.

For use we need atleast 100 threads to be served at a time. Can we increase the thread pool size to 100, Will it make any issues?

Selvakumar Ponnusamy
  • 5,363
  • 7
  • 40
  • 78

2 Answers2

2

In my project, we use about 30 thread pool to serve about 100 concurrent. Play 1.x works very fast so the threads can be released before next request to process.

But you should make load test your code... I think it's not good if you increase thread pool to 100.

By the way, you should use async job to implement your application as Play recommended: http://www.playframework.com/documentation/1.2.7/asynchronous

KimKha
  • 4,370
  • 1
  • 37
  • 45
0

Play is build around the idea of handling short requests as fast as possible and therefor being able to keep the thread pool as small as possible. The main reasons for wanting a small pool are to keep resources consumption low instead of wasting.

Play and Java can happily run with a higher thread pool, like 100 or 1000 (although your server might not always support it, some Linux distributions for example have a fixed limit of threads per application per user), but it is recommended to analyze your problem and see if you really need that big pool.

In most situations, needing a big pool means that you have to many blocking threads and should look into Play's async features or that you have an action that tries to do to many things at once, that would perform better when chopped into smaller pieces. If a request results in a long blocking thread on the server, this usually means it also results in a long, blocked interface on the users end.

Community
  • 1
  • 1
gpgekko
  • 3,506
  • 3
  • 32
  • 35