Any recommendations on how to evaluate Puma’s performance as we increase the number of threads per worker? #3241
-
Hi Puma community, I consider myself pretty new to Puma and have a question for you veterans and experts. In our heavy production environment, we have a Rails service on Puma that currently has 1 worker per CPU core, and has 1 thread per worker. There are 128 cores per instance Based on the Puma metrics, we see that there were times we might be getting close to running out of available threads per instance, ie getting close to 128. So we have recently increased the number of threads per worker from 1 to 2, and now have not seen the case of running out of threads per instance so far( because now we got 256) My question is how I can also evaluate if the amount of time a request takes before getting processed by an available thread has improved since increasing the number of threads. I am not sure this can be easily measured in Puma? Also,the "backlog" metric for Puma didn't really change much when the threads got doubled Thanks, interested to hear all your thoughts |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
IME there are pretty heavy diminishing returns on multithreaded performance once you go past 64 CPUs on a single board. Do you mean 128 cores on a single motherboard?
It is quite easily measured in fact! What you're looking for is request queue time. You measure it in a way that isn't Puma-specific: timestamp each request at your load balancer with an HTTP header (traditionally Puma backlog is for something else entirely. |
Beta Was this translation helpful? Give feedback.
IME there are pretty heavy diminishing returns on multithreaded performance once you go past 64 CPUs on a single board. Do you mean 128 cores on a single motherboard?
It is quite easily measured in fact! What you're looking for is request queue time. You measure it in a way that isn't Puma-specific: timestamp each request at your load balancer with an HTTP header (traditionally
X-Request-Start
) that has the current time in mill…