title: what is worker_processes and worker_connections in Nginx?
body: <p>Please help me understand what <code>worker_processes</code> and <code>worker_connections</code> are in Nginx and what is the relation between them. I have looked under <a href="http://wiki.nginx.org/DirectiveIndex" rel="noreferrer">Nginx directives</a> it says:</p>
  <p><code>worker_processes</code></p>
  <blockquote>
  <p>A worker process is a single-threaded process.</p>
  <p>If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores, then you may set worker_processes to be equal to the number of CPUs or cores.</p>
  <p>If you are serving a lot of static files and the total size of the files is bigger than the available memory, then you may increase worker_processes to fully utilize disk bandwidth.</p>
  </blockquote>
  <p><code>worker_connections</code></p>
  <blockquote>
  <p>The worker_connections and worker_processes from the main section allows you to calculate max clients you can handle:</p>
  <p><code>max clients = worker_processes * worker_connections</code></p>
  </blockquote>
  <p>So I understand that <code>worker_processes</code> is single threaded and its value is helpful in CPU-intensive work, but I am unable to understand &quot;allows you to handle max clients you can handle&quot;.</p>
  <p>If anyone can give an example as given in <code>worker_processes</code> it would be helpful for me to understand.</p>