Uwsgi + django via Nginx - uwsgi / spawn settings?

I'm leaning towards uwsgi + nginx for my Django application, can anyone share a better method to start my uwsgi processes? Does anyone have experience configuring uwsgi?

+5
source share
3 answers

Running on OSX

Upstart / init on nodes.

uwsgi also has its own process manager, so you can just start it as well.

Setup:

Check the mailing list for recommendations on your specific requirements. Uwsgi is awesome, it's a complete deployment solution.

Nginx 0.8.40 uwsgi , nginx, uwsgi .

+4

, fabfile.py(, python):

def start_uwsgi():
    with cd(env.server.uwsgi):
        if(exists('server.pid')):
            stop_uwsgi()
            run('sleep 1')
        run('source venv/bin/activate;uwsgi --ini uwsgi.ini;'))

def stop_uwsgi():
    with cd(env.server.uwsgi):
        if(exists('server.pid')):
            run('source venv/bin/activate;uwsgi --stop server.pid;'))

uwsgi.ini :

[uwsgi]
socket = :{{your_port}}
master = true
vhost = true
no-site = true
processes = 1
enable-threads = true
pidfile = server.pid
daemonize = server.log
auto-procname = true
procname-prefix = servername_

:

  • daemonise, , uwsgi /ssh.
  • vhost uwsgi, , , , -
  • pidfile , uwsgi --stop pidfile, uwsgi --start pidfile
  • procname procname-prefix/append , ps -u username | grep some_string
+1

supervisord , .

0

All Articles