-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Consider using gevent
for gunicorn
#1017
Comments
@sobolevn not sure that we must force users to use it. In most setups default gunicorn worker is enough. Maybe we should just mention it? |
Why do you think that |
The main reason is that we can't determine an effective number of workers. For classic workers, it's defined in docs There is an option to set a fair amount of workers and greenlets by default in the template and add a note for a user. But I'm afraid that some users will ignore that note and wouldn't identify problems in production. |
Can you please provide a link to this problem? I have never actually knew about it 😆 |
https://docs.gunicorn.org/en/stable/design.html#how-many-workers Last two paragraphs. |
Ah, I forget to note, that the number of workers we can set programmatically in python file. And use that file as config |
Sorry, but I am missing gevent-related problems in this doc: https://docs.gunicorn.org/en/stable/design.html#how-many-workers 🙁 |
Next one =) https://docs.gunicorn.org/en/stable/design.html#how-many-threads There is no sign of how many workers and greenlets should be deployed. In fact, I'm surprised that there is really no word about that. So, from my experience, all the numbers should be adjusted for the machine. |
Do you have any specific formula? We can adjust that to limits in our |
Unfortunately, I don't. It depends on the project's purpose. If it's microservice-like, then 1 worker and 1k greenlets. If it's a big project monolith-like, then several workers (based on cpu count) with 2-2.5k greenlets. Worth noting gunicorn server.wsgi:application \
-k gevent \
--workers 3 \ # three workers
--worker-connections 2500 \ # 2.5k greenlets
--max-requests 500 \ # each greenlet lives for 500 requests
--max-requests-jitter 200 # jitter for previous option |
I think gthreads could be a good default option too.
|
Links:
@AlwxSin what would you say?
The text was updated successfully, but these errors were encountered: