Skip to content
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

Exporting worker utilization to statsD #2295

Open
calebwoofenden opened this issue Mar 24, 2020 · 3 comments · May be fixed by #2655
Open

Exporting worker utilization to statsD #2295

calebwoofenden opened this issue Mar 24, 2020 · 3 comments · May be fixed by #2655

Comments

@calebwoofenden
Copy link

This issue is a feature request.

Gunicorn exports some useful metrics to statsD, including the number of gunicorn workers. However, it doesn't export the number of workers currently serving a request, or equivalently, a percentage worker utilization. This is something I've been trying to figure out how to determine externally from gunicorn, and so far have been unsuccessful with. I think it might be easier to update gunicorn's statsd logging to include worker utilization, which I imagine could be found from asking the master gunicorn process how many workers are busy.

My use case for this metric is to feed it to the Kubernetes HorizontalPodAutoscaler so that I can scale my gunicorn deployment based on gunicorn worker utilization.

I would be willing to work on this and create a pull request. What do people think?

@mam8cc
Copy link

mam8cc commented Apr 2, 2020

This is something we are actively searching for a solution to. Currently we scale based on CPU/Memory but that doesn't solve the problem of a pod getting several long running requests that are not CPU or memory bound.

@PedroArvela PedroArvela linked a pull request Sep 17, 2021 that will close this issue
4 tasks
@DeoLeung
Copy link

also currently I found the number of workers metric only updated when gunicorn starts. if we had a long running application, it's hard to use the metric.

@benoitc
Copy link
Owner

benoitc commented Sep 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants