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

Update appservice.bicep with gunicorn config #2571

Merged
merged 2 commits into from Jul 28, 2023
Merged

Conversation

pamelafox
Copy link
Member

This PR sets PYTHON_ENABLE_GUNICORN_MULTIWORKERS by default on App Service, when python runtime is chosen. When Oryx sees that env variable, it will auto configure the gunicorn server to use a worker count based off the formula of CPU_COUNT * 2 + 1. That's generally better than always using a single worker.

Here's Oryx docs about the config option:
https://github.com/microsoft/Oryx/blob/5239b0416cdddcf5bf0aef6703eb339efa865d67/doc/runtimes/python.md?plain=1#L101

The only reason this isn't default on App Service is for backwards compatibility reasons, but I think it should be default for all our App Service Python apps that dont specify their own appCommandLine.

@pamelafox
Copy link
Member Author

I tested this change in the search-openai sample:
Azure-Samples/azure-search-openai-demo#461

Co-authored-by: Wei Lim <weikanglim@gmail.com>
@vhvb1989 vhvb1989 merged commit d920b17 into Azure:main Jul 28, 2023
4 checks passed
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.

None yet

3 participants