Too many uwsgi threads running Too many uwsgi threads running nginx nginx

Too many uwsgi threads running


You're starting uWSGI emperor, so you shouldn't pass wsgi-file directly to it. Remove that parameter from your uwsgi.conf file.

When using emperor, you shouldn't daemonize your uWSGI instances, because emperor will loose connection to it, that probably causes spawning new instances on each request (emperor doesn't know that there are some instances, because they've daemonized so it spawns new one to handle requests). You should remove daemonize from your uWSGI configuration.

Also, using vhost when explicitly pointing to wsgi file shouldn't be done. If you don't know what this parameter does or don't think that you're need it, remove it.

After changes, your files should look like:

uwsgi.ini file:

[uwsgi]socket = /tmp/mySocket.sockmaster = trueprocesses = 4max_request =  300vacuum = truedie-on-term = trueclose-on-exec = trueharakiri = 30wsgi-file = /home/virtualEnv/server/wsgi.pyvirtualenv = /home/virtualEnvpythonpath = /home/virtualEnv/myServerchdir=/home/virtualEnv/myServerpidfile=/tmp/myFile.pidlog-reopen = truechmod-socket = 664gid = www-datauid = www-data

uwsgi.conf file:

description "uWSGI Emperor"start on runlevel [2345]stop on runlevel [!2345]respawnexec uwsgi --emperor /etc/uwsgi/vassals/

wsgi.py file won't change.

If you want to have logfile from your uwsgi server, use:

logger                  = file:/var/log/uwsgi/uwsgi-@(exec://date +%%Y-%%m-%%d).log

instead of daemonize.