Is there any formula to discover the number of workers and threads in a Rails application using puma ? Worker would be the number of cores ? How about threads ?? I've tried to search in similar topics, but it was not clear to me...
Asked
Active
Viewed 5,748 times
6
-
I added the references that I've used to learn how to tune my rails server. Hope it helps. – coding addicted Jul 04 '16 at 21:50
3 Answers
5
Even if your not on Heroku they have good doc about Puma. Like this one: link
This answer helped me when I was asking myself the same question.
Basically I set the number of workers matching the number of cores and the number of threads according to the ram amount. But I'm not doing this with a rocket science formula (maybe I should), it's more like a try and adjustment process.
As a bonus reading I would suggest this article about how to scale a rails app to 1000 req/sec, it gives interesting suggestions: link

Community
- 1
- 1

coding addicted
- 3,422
- 2
- 36
- 47
-
The article is about 1000 rec/minute, which is about ~17/sec which is not much. – Juanse Cora May 08 '21 at 14:53
0
If you are using Heroku you can set your number of workers using puma according to your web dyno size.
For some applications two Puma workers will cause you to use more RAM than a standard-1x dyno can provide

Antima Gupta
- 381
- 1
- 8