1

Currently I am using nginx to reverse proxy paster, to server Mediacore (a Pylons app). However, this configuration fails when I try to submit a video. I particualrly try to avoid fat appache, which is the official Mediacore recommendation. In a famous "benchmark of python webservers" I've seen that uwsgi has amazing performance but it is rather newcommer. So I could not find any good tutorial for it which is both comprehensive and noob-friendly. So I I appreciate if you could refere me to such guide to set up any of the high-performance python webservers. Thanks in advance for your hints.

alfish
  • 3,027
  • 15
  • 45
  • 68

1 Answers1

2

Deploying pylons apps is very easy on uWSGI. Simply add this section to your deployment.ini

[uwsgi]
master = 1
processes = 4
socket = :3031
home = <venv>

Substitute <venv> with the full path of your virtualenv and eventually change the socket port to whatever you want/need

Now go to nginx.conf and modify it to something like this:

location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3031;
}

Obviously set the uwsgi_pass to the right port of the uWSGI socket

Now start uwsgi

uwsgi --ini-paste <path>

Where <path> is the full path of the deployment.ini file

If you are on a big server you can increse the number of processes too

Unbit
  • 21
  • 1
  • When I run 'uwsgi --ini-paste /path/to/deployment.ini' I get this: 'uwsgi: unrecognized option '--ini-paste'. And this is while I've installed uwsgi using 'pip install http://projects.unbit.it/downloads/uwsgi-latest.tar.gz' – alfish Jan 27 '11 at 20:15
  • That is strange, could it be that you have another (old) binary of uwsgi in your path ? Try to 'pip install' and run it directly from your virtualenv – Unbit Jan 28 '11 at 06:10
  • I did 'pip install uwsgi' on my virtualenv and then run the command 'uwsgi --ini-paste deployment.ini' while I was on my project root and in the virtualenv, but still get the same error :( – alfish Jan 29 '11 at 21:05
  • what 'uwsgi --version' reports ? if you use --ini instead on --ini-paste does the stack loads ? – Unbit Jan 30 '11 at 06:37
  • Are you using pypy? I had this 'uwsgi: unrecognized option '--ini-paste' problem too, and on pypy, you need `--pypy-paste` instead – hamx0r Nov 30 '16 at 19:55