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

Docs: workers = 1 when WEB_CONCURRENCY is not set #940

Closed
pawamoy opened this issue Jan 21, 2021 · 3 comments · Fixed by #943
Closed

Docs: workers = 1 when WEB_CONCURRENCY is not set #940

pawamoy opened this issue Jan 21, 2021 · 3 comments · Fixed by #943
Labels
docs Improve documentation

Comments

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Jan 21, 2021

Hello, thanks for this great ASGI server 🙂

I have an application that must use only one worker (it's not thread-safe), and so I wanted to confirm that, by default, uvicorn only uses one worker. But I had to read the source code

self.workers = workers or 1

...to confirm that when WEB_CONCURRENCY is not defined, and workers is not specified, 1 is used.

Would you accept a PR adding that information to the docs (there are 4-5 places where this can be added)?

@euri10
Copy link
Member

euri10 commented Jan 21, 2021

I have an application that must use only one worker (it's not thread-safe), and so I wanted to confirm that, by default, uvicorn only uses one worker. But I had to read the source code

workers set the number of processes not threads, just to be clear

...to confirm that when WEB_CONCURENCY is not defined, and workers is not specified, 1 is used.

Would you accept a PR adding that information to the docs (there are 4-5 places where this can be added)?

sure why not, I edited your title to put 2 Rs though, easier to find

@euri10 euri10 changed the title Docs: workers = 1 when WEB_CONCURENCY is not set Docs: workers = 1 when WEB_CONCURRENCY is not set Jan 21, 2021
@euri10 euri10 added the docs Improve documentation label Jan 21, 2021
@pawamoy
Copy link
Sponsor Contributor Author

pawamoy commented Jan 21, 2021

Thanks!

workers set the number of processes not threads, just to be clear

Oh yes, I used "thread-safe" because I'm not sure there's a "process-safe" term? 😅

OK I'll try to send a PR soon 🙂

@euri10
Copy link
Member

euri10 commented Jan 21, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improve documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants