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

Increase gunicorn timeout and workers #176

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Increase gunicorn timeout and workers #176

merged 4 commits into from
Dec 11, 2024

Conversation

henhuy
Copy link
Contributor

@henhuy henhuy commented Dec 6, 2024

No description provided.

@henhuy henhuy requested a review from nesnoj December 6, 2024 08:21
@nesnoj
Copy link
Contributor

nesnoj commented Dec 9, 2024

Did not solve hanging of app. Solution brought by fix in mapengine 111f422

@nesnoj nesnoj closed this Dec 9, 2024
@henhuy
Copy link
Contributor Author

henhuy commented Dec 10, 2024

Increasing worker amount still could be a good solution - but if it works properly now, maybe we should keep it as is?!

@nesnoj
Copy link
Contributor

nesnoj commented Dec 10, 2024

Increasing worker amount still could be a good solution - but if it works properly now, maybe we should keep it as is?!

Yes, you're right.

The docs say
"Gunicorn relies on the operating system to provide all of the load balancing when handling requests. Generally we recommend (2 x $num_cores) + 1 as the number of workers to start off with."
which would result in 49 which is way too large according to other info I found.
This thread explains best, however there's no single truth and the optimal config depends on the number of requests, their duration and synchronicity, the docs recommend "tune using TTIN and TTOU signals while the application is under load". I'd like to avoid this finetuning.
So maybe --workers=4 is a good starting point.

And it might make sense to increase threads too.

Moreover, the docs recommend async workers for certain use cases, e.g. "Applications making long blocking calls (Ie, external web services)" to avoid processes being blocked. Except for WMS layers we won't have ext. resources and they are not supposed to be "long blocking calls". ESys optimization processes run in a separate container and checked by the app frequently, so they do not block the web processes, is this correct?
What do you think about synchronicity?

@nesnoj nesnoj reopened this Dec 10, 2024
@henhuy
Copy link
Contributor Author

henhuy commented Dec 11, 2024

So maybe --workers=4 is a good starting point.

Yep - maybe we start with this

Moreover, the docs recommend async workers for certain use cases, e.g. "Applications making long blocking calls (Ie, external web services)" to avoid processes being blocked. Except for WMS layers we won't have ext. resources and they are not supposed to be "long blocking calls". ESys optimization processes run in a separate container and checked by the app frequently, so they do not block the web processes, is this correct?
What do you think about synchronicity?

Yes, I think you are right - except for ES simulation, we don't need async stuff and ES is already using celery, so we are fine there IMHO.

Copy link
Contributor

@nesnoj nesnoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thx!

@nesnoj nesnoj merged commit b7ce4a7 into dev Dec 11, 2024
1 check passed
@nesnoj nesnoj deleted the fix/worker_timeout branch December 11, 2024 08:47
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

Successfully merging this pull request may close these issues.

2 participants