I am leaning towards uwsgi+nginx for my Django app, can anyone share the best method for starting up my uwsgi processes? Does anyone have experience tuning uwsgi?
Can I then ditch NGINX? uWSGI could be used as a standalone web server in production, but that is not it's intentional use. It may sound odd, but uWSGI was always supposed to be a go-between a full-featured web server like NGINX and your Python files.
Launchd on OSX
Upstart/init on the unices.
uwsgi also has its own process manager, so you can just run that as well.
Tuning:
Check the mailing list, for advice on your particular requirements. Uwsgi is amazing, it is a complete deploy solution.
Nginx above 0.8.40 will build the uwsgi bindings by default, Build nginx, build uwsgi and you are golden.
these are the functions i use in my fabfile.py file (check out python fabric if you haven't already):
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;'))
In my uwsgi.ini file i specify:
[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_
for me the main gotyas were:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With