Does 1 web worker with Gunicorn always mean that there is only 1 process?

Viewed 1900

This is probably a fairly basic question. I'm learning about the basics of web app development and in this regard about concurrency and parallelism.

If I start my Flask web app with Gunicorn set to 1 worker:

gunicorn -w 1 server:app

Will this always mean that there's only one process running my app? Or is this not for certain and there are workers which might not only use threads, greenlets, ... but spawn an entire additional process of my app?

In case of the latter, does this apply to sync or gevent workers, too, or are those always one process?

1 Answers

This question has an answer in one of the posts on Gunicorn's issue tracker on GitHub:

Yes. However, you will see two processes running. One is the Gunicorn master process, which controls the worker processes. With the number of workers set to 1 you'll have only one worker process.

Source: https://github.com/benoitc/gunicorn/issues/2082#issuecomment-522343242

Related