-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 exceeds the specified number of workers in actual processes. #3204
Comments
Loggingloglevel = 'debug' # Server Hookson_starting = _on_starting pre_request = _pre_requestpost_request = _post_requestchild_exit = _child_exit Server Mechanicstmp_upload_dir = '/tmp/gunicorn' Server Socketbind = '0.0.0.0:8183' workers = 30 max_requests = 1000timeout = 3600 my config, but now |
First starting fresh workers, only then shutting down old ones, thus briefly exceeding the target count, is how gunicorn enables use cases for serving without noticeable interruption. |
Alright, I understand how it works,but the ongoing presence of old workers failing to shut down may result in a continuous increase in server memory usage. Is this issue related to the configured timeout settings, and is there a more direct configuration available? Specifically, a mechanism to terminate processes that should have shut down but haven't after a certain period of time. |
Mind sharing logs and Do you see any unexpected |
1,service status Notice: journal has been rotated since unit was started, output may be incomplete. 2,[root@vdi-175 ~]# ps -ef | grep console.wsgi:application gunicorn logs thorconsole.log.6:2024-04-23 10:09:33,790 [399962]DEBUG config._post_worker_init:28 [none] gunicorn: post-worker-init worker <Worker 399962> thorconsole.log.3:2024-04-23 12:50:48,715 [2587704]DEBUG config._post_worker_init:28 [none] gunicorn: post-worker-init worker <Worker 2587704> thorconsole.log.2:2024-04-23 13:21:39,758 [3132603]DEBUG config._post_worker_init:28 [none] gunicorn: post-worker-init worker <Worker 3132603> thorconsole.log.1:2024-04-23 14:15:40,558 [4188905]DEBUG config._post_worker_init:28 [none] gunicorn: post-worker-init worker <Worker 4188905> thorconsole.log:2024-04-23 14:33:57,476 [302161]DEBUG config._post_worker_init:28 [none] gunicorn: post-worker-init worker <Worker 302161> [root@vdi-175 ~]# lsof -i:8183 | grep LISTEN ps -fo PID STARTED ELAPSED |
When I set 30 workers, normally it should maintain 30 workers running. However, during stress testing or when the API responses are slow, it exceeds the specified number of workers. How can I solve this?
The text was updated successfully, but these errors were encountered: