-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Gunicorn CPU usage increase over a time #2387
Comments
Does a tool like The samples you've taken appear to be from the master gunicorn process. It should spend most of its time in If you enable the |
I'm closing that issue. After some further investigation I found that its not directly related to Gunicorn but Prometheus client in multiprocess mode (see prometheus/client_python#568). |
I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time.
It is not related to number of request processed in a given time range.
I used https://github.com/benfred/py-spy to investigate whats going on on two gunicorn pods. One was quite fresh another one was running for couple of days.
Fresh pod:
Old pod:
So it seems that older pod spent much more time on gunicorn/arbiter.py:357
ready = select.select([self.PIPE[0]], [], [], 1.0)
than fresh one (within similar number of py-spy samples). The number of request was also similar because those pods are attached to the same load balancer.I tried to minimize that issue by setting
max_requests
Gunicorn flag but it didn't help. So that's why I think is master process problem.Have you ever noticed such issue or have any ideas how to fix that?
The text was updated successfully, but these errors were encountered: