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

How to programmatically get the number of current worker connections? #3152

Open
andrii-korotkov-verkada opened this issue Feb 8, 2024 · 2 comments

Comments

@andrii-korotkov-verkada
Copy link

andrii-korotkov-verkada commented Feb 8, 2024

Hello,
I hope your day is going well. I'm looking to add some monitoring for services using gunicorn for the number of worker connections. This is to know when the workers are approaching the limit configured using --worker-connections flag and when it needs to be adjusted. I'm curious if there is some function like get_current_number_of_gunicorn_worker_connections() I can call in a background thread publishing the metrics? Also if there's a function is_running_gunicorn_worker() to skip setups which won't enable gunicorn.
Thank you!

@andrii-korotkov-verkada andrii-korotkov-verkada changed the title How to programmatically get the number of current worker connections How to programmatically get the number of current worker connections? Feb 8, 2024
@benoitc
Copy link
Owner

benoitc commented Feb 15, 2024

use the metric?

@andrii-korotkov-verkada
Copy link
Author

Which metric is available for this?

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

No branches or pull requests

2 participants