How can I programmatically retrieve the current number of Gunicorn workers from within a WSGI app running in Gunicorn? I'm using Flask if that makes any difference.
From terminal:
ps aux | grep gunicorn | grep -v grep | wc -l
gunicorn
could be the app name if that is present in the command (if you're running just one app this example would work fine, else it would show the total amount of workers of all apps)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With