title: How to determine the number of worker processes
body: <p>I'm following along with a tutorial for setting up nginx on ubuntu. I have nginx installed and it started successfully. The tutorial says this about adjusting and setting nginx processes and worker connections</p>
  
  <pre><code>It is often recommended to set the number of NGINX workers equal the number of processors, you can determine the number of processors using:
  
  cat /proc/cpuinfo | grep processor 
  </code></pre>
  
  <p>When I run the command, I got a 0.  </p>
  
  <pre><code>processor   : 0
  </code></pre>
  
  <p>Therefore, according to the tutorial, I should set the config to 0 in the appropriate location</p>
  
  <pre><code>sudo nano /etc/nginx/nginx.conf
  
  
  worker_processes 0;
  </code></pre>
  
  <p>The tutorial's example has a 1. However, I was a little concerned not only about seeing a 0 when I ran the output, but also when I ran <code>ps -ef | grep nginx</code>, I got this output, suggesting there are multiple workprocesses?</p>
  
  <pre><code>root      1824     1  0 19:40 ?        00:00:00 nginx: master process /usr/sbinnginx
  www-data  1825  1824  0 19:40 ?        00:00:00 nginx: worker process
  www-data  1826  1824  0 19:40 ?        00:00:00 nginx: worker process
  www-data  1827  1824  0 19:40 ?        00:00:00 nginx: worker process
  www-data  1828  1824  0 19:40 ?        00:00:00 nginx: worker process
  michael   1832  1378  0 19:44 pts/1    00:00:00 grep --color=auto nginx
  </code></pre>
  
  <p>Is it a matter for concern that I see a 0 when I run <code>cat /proc/cpuinfo | grep processor</code> and what should I set <code>worker_processes 0;</code> to in /etc/nginx/nginx.conf?</p>