简体   繁体   中英

Get the number of gunicorn workers?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM