title: What is standard number of workers and threads to use for uWSGI server?
body: <p>I have a Nginx web server with uWSGI app server installed on a single CPU Ubuntu 14.04 image. </p>
  
  <p>This uWSGI app server successfully handles a Flask app requests. 
  The problem I am facing is that sometimes requests from a single client will time out for an extended period of time (1-2 hours).</p>
  
  <p>This was happening without specifying workers or threads in my uwsgi.conf file. 
  Is there an ideal amount of workers/threads to be used per CPU?</p>
  
  <p>I am using emperor service to start the uWSGI app server. 
  This is what my uwsgi.conf looks like</p>
  
  <pre><code>description "uWSGI"
  start on runlevel [2345]
  stop on runlevel [06]
  respawn
  
  env UWSGI=/var/www/parachute_server/venv/bin/uwsgi
  env LOGTO=/var/log/uwsgi/emperor.log
  
  exec $UWSGI --master --workers 2 --threads 2 --emperor /etc/uwsgi/vassals --die-on-term --uid www-data --gid www-data --logto $LOGTO --stats 127.0.0.1:9191
  </code></pre>
  
  <p>Could this be a performance problem in regards to nginx / uwsgi or is it more probable that these timeouts are occuring because I am only using a single CPU?</p>
  
  <p>Any help is much appreciated!</p>