master_process
The 'master_process' directive controls the operation of the NGINX master process.
Description
The 'master_process' directive is a flag that determines whether NGINX will run in master mode or in single process mode. When set to 'on', the master process is enabled, allowing NGINX to manage worker processes. This is the standard operation mode for NGINX, where the master process handles the management of worker processes, including their creation and termination as needed based on traffic demand.
If 'master_process' is set to 'off', NGINX will operate without a master process and will run in a single process mode. In this mode, there are no worker processes; NGINX will handle all requests within a single process. This might be useful for debugging purposes or lightweight environments where multiprocessing is not needed but is less efficient than the typical master-worker model. The configuration of this directive is essential for ensuring NGINX functions in its expected multi-threaded environment, where multiple worker processes enhance performance and resource utilization.
The parameter for this directive is a simple flag—"on" or "off"—indicating whether the master process should be enabled or disabled. It typically appears in the main context of the nginx configuration file, and its usage may vary depending on specific deployment requirements, such as resource constraints or operational goals.
Config Example
master_process on;
Setting 'master_process' to 'off' will disable worker processes, which may lead to decreased performance under load.
When running in 'off' mode, ensure that your configuration supports running NGINX without worker processes.