title: Python: uWSGI configuration for NGINX+FLASK
body: <p>I successfully managed to install:
  NGINX + uWSGI + Flask
  on a CentOS 6.x server</p>
  
  <p>but I still have some doubts in terms of configuration:</p>
  
  <p>1) I am running NGINX as a service: service nginx start/stop/restart<br/>
  if I type "ps aux | grep nginx", I can see 2 processes:<br/>
  - (by user root) master process /usr/sbin/nginx -c /etc/nginx/nginx.conf<br/>
  - (by user nginx) worker process<br/>
  is that OK?</p>
  
  <p>2) I setup a virtualenv for Flask and installed the uWSGI package under such virtualenv.<br/>
  Currenty I am starting the uWSGI manually by typing "uwsgi /somedir/uwsgi.ini", where uwsgi.ini is as follows:</p>
  
  <pre><code>chdir = /myappdir
  uid = pyuser
  chmod-socket = 666
  socket = /tmp/uwsgi.sock
  module = run
  callable = app
  virtualenv = /myappdir/myvirtualenv
  </code></pre>
  
  <p>Is it possible to start uWSGI as a service, similarly to NGINX (as described at point 1) ? Is such case should the user be root or non-root?</p>
  
  <p>3) When I start the uWSGI, I am currently getting the following warning:</p>
  
  <pre><code>*** Python threads support is disabled. You can enable it with --enable-threads ***
  </code></pre>
  
  <p>I realized that in the "uwsgi.ini" configuration file you can also configure a number of processes and threads. Considering the server I am running has just 1 core, can I set up multiple processes and threads? and if so, how many?</p>
  
  <p>3b) On the NGINX configuration file "/etc/nginx/nginx.conf" it is also possible to specify "worker_processes", which by default are 1. Can I increase that, or it can be higher than 1 only for multicore servers?</p>
  
  <p>4) Beside the threads support disabled, when I start the uWSGI I also get these warnings. What do they mean?</p>
  
  <pre><code>*** WARNING: you are running uWSGI without its master process manager ***
  *** Operational MODE: single process ***
  *** uWSGI is running in multiple interpreter mode ***
  </code></pre>