-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep Puma worker metrics segregated by PID #253
Comments
Sounds reasonable to me ... @nateberkopec any concerns here, should we be providing instrumentation down to this fidelity? |
Ah, sorry, a common misunderstanding. We should really have named the Puma stats option something other than As we specify in the docs you linked to:
What Puma.stats reports as To log this you would probably need to do something with netstat or use a request header like |
Ah -- so what causes this gauge to be non-zero then? |
@KaoruDev Backlog will be >0 as long as any thread is busy. Roughly most of the time, backlog == number of threads which have accepted a connection but haven't yet finished responding. So like I said Your thesis is still kind of true in a way though - Puma workers with higher So I would say upgrade to Puma 6 if you haven't already! |
I'm investigating behavior in prod where a few requests seemingly create a backlog of requests in Puma.
From my understanding of the Puma docs each worker will randomly pull a request from the UNIX socket. I believe if one of those Workers is processing a "heavy" request, a backlog of requests can start causing the high latency for requests that are typically "fast". However it not possible me to verify this as all the Worker stats are aggregated here.
I propose avoiding summing the metrics and adding the PID of each worker. I.E:
If PID is too high of a cardinality, idx seems reasonable to me too.
The text was updated successfully, but these errors were encountered: