From Nginx’s Beginner’s Guide:
nginx has one master process and several worker processes. The main purpose of the master process is to read and evaluate configuration, and maintain worker processes. Worker processes do actual processing of requests. nginx employs event-based model and OS-dependent mechanisms to efficiently distribute requests among worker processes. The number of worker processes is defined in the configuration file and may be fixed for a given configuration or automatically adjusted to the number of available CPU cores.
It is also suggested that the max number of
worker_processes shall be calculated as
number of core * 2, which is equivalent in arithmetic sense to the notion of multithreading.
E.g. in a setting of a single 2-core CPU, setting
worker_processes = 5 and assume
worker_connections = 512, will my machine breaks if I am maxing out my web server with simultaneous 2048+ connections?
Question arises from deploying a Flask application with gunicorn with the following command:
gunicorn --bind 0.0.0.0:8888 server --log-level debug --workers=4
multi-threading under the hook ?
Please correct me if I had wrongly interpreted / mixed up the terms
workers in both context.