They are having some hiccups now, but so far my contender for WSGI
servers is uwsgi:
http://projects.unbit.it/uwsgi contains the feature set, most notably:
"static configuration option based on xml files, pure-python module
using ApplicationsDict, wsgi file, environment variables, Paste, INI
files or LDAP"
http://projects.unbit.it/uwsgi/wiki/Example:
"Flask is an amazing microframework. Deploying it on uWSGI is
super-fast/super-easy
(call it myapp.py)
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return "Hello World!"
if __name__ == '__main__':
app.run()
./uwsgi -s /tmp/mysock.sock --module myapp --callable app"
I'm going to check this out tomorrow night. I just wanted to let the
list know, in case there are oversimplifications or errors in the
config...
Could I ask why you chose uwsgi? I've been struggling to make a selection from the myriad of wsgi servers available, I've been using gunicorn because it's so easy to use. Looking at these benchmarks, gevent appears to have an edge: http://nichol.as/benchmark-of-python-web-servers <http://nichol.as/benchmark-of-python-web-servers> On Wed, Sep 15, 2010 at 5:12 AM, kevin beckford <chiggsy@lazyweb.ca> wrote: > They are having some hiccups now, but so far my contender for WSGI > servers is uwsgi: > > http://projects.unbit.it/uwsgi contains the feature set, most notably: > > "static configuration option based on xml files, pure-python module > using ApplicationsDict, wsgi file, environment variables, Paste, INI > files or LDAP" > > > > http://projects.unbit.it/uwsgi/wiki/Example: > > > > "Flask is an amazing microframework. Deploying it on uWSGI is > super-fast/super-easy > > (call it myapp.py) > > from flask import Flask > app = Flask(__name__) > > @app.route('/') > def hello_world(): > return "Hello World!" > > if __name__ == '__main__': > app.run() > > ./uwsgi -s /tmp/mysock.sock --module myapp --callable app" > > > > > I'm going to check this out tomorrow night. I just wanted to let the > list know, in case there are oversimplifications or errors in the > config... >
I use uwsgi too. My config with it is very simliar to yours Eugen. Works like a charm. I use it behind a cherokee server. A nice tip would be to create a upstart script to init the uwsgi script. See this: http://www.westphahl.net/blog/2010/4/8/running-django-nginx-and-uwsgi/ This benchmark is really eyecandy. It made me wonder if i should migrate to fapws3 or gevent. But, with uwsgi, those three seem like the fastest. 2010/9/15 bruce bushby <bruce.bushby@googlemail.com> > Could I ask why you chose uwsgi? > > I've been struggling to make a selection from the myriad of wsgi servers > available, I've been using gunicorn because it's so easy to use. Looking at > these benchmarks, gevent appears to have an edge: > http://nichol.as/benchmark-of-python-web-servers > > > > <http://nichol.as/benchmark-of-python-web-servers> > > On Wed, Sep 15, 2010 at 5:12 AM, kevin beckford <chiggsy@lazyweb.ca>wrote: > >> They are having some hiccups now, but so far my contender for WSGI >> servers is uwsgi: >> >> http://projects.unbit.it/uwsgi contains the feature set, most notably: >> >> "static configuration option based on xml files, pure-python module >> using ApplicationsDict, wsgi file, environment variables, Paste, INI >> files or LDAP" >> >> >> >> http://projects.unbit.it/uwsgi/wiki/Example: >> >> >> >> "Flask is an amazing microframework. Deploying it on uWSGI is >> super-fast/super-easy >> >> (call it myapp.py) >> >> from flask import Flask >> app = Flask(__name__) >> >> @app.route('/') >> def hello_world(): >> return "Hello World!" >> >> if __name__ == '__main__': >> app.run() >> >> ./uwsgi -s /tmp/mysock.sock --module myapp --callable app" >> >> >> >> >> I'm going to check this out tomorrow night. I just wanted to let the >> list know, in case there are oversimplifications or errors in the >> config... >> > > -- "A arrogância é a arma dos fracos." =========================== Italo Moreira Campelo Maia Graduado em Ciência da Computação - UECE Desenvolvedor WEB e Desktop (Java, Python, Lua) Coordenador do Pug-CE ----------------------------------------------------- http://www.italomaia.com/ http://twitter.com/italomaia/ http://eusouolobomau.blogspot.com/ ----------------------------------------------------- turtle linux 910 - http://tiny.cc/blogturtle910 ===========================
Sometimes the benchmark is difficult to read, moving your mouse over the legend will highlight the graph data. On Wed, Sep 15, 2010 at 12:35 PM, Italo Maia <italo.maia@gmail.com> wrote: > I use uwsgi too. My config with it is very simliar to yours Eugen. Works > like a charm. I use it behind a cherokee server. A nice tip would be to > create a upstart script to init the uwsgi script. See this: > http://www.westphahl.net/blog/2010/4/8/running-django-nginx-and-uwsgi/ > > This benchmark is really eyecandy. It made me wonder if i should migrate to > fapws3 or gevent. But, with uwsgi, those three seem like the fastest. > > 2010/9/15 bruce bushby <bruce.bushby@googlemail.com> > > Could I ask why you chose uwsgi? >> >> I've been struggling to make a selection from the myriad of wsgi servers >> available, I've been using gunicorn because it's so easy to use. Looking at >> these benchmarks, gevent appears to have an edge: >> http://nichol.as/benchmark-of-python-web-servers >> >> >> >> <http://nichol.as/benchmark-of-python-web-servers> >> >> On Wed, Sep 15, 2010 at 5:12 AM, kevin beckford <chiggsy@lazyweb.ca>wrote: >> >>> They are having some hiccups now, but so far my contender for WSGI >>> servers is uwsgi: >>> >>> http://projects.unbit.it/uwsgi contains the feature set, most notably: >>> >>> "static configuration option based on xml files, pure-python module >>> using ApplicationsDict, wsgi file, environment variables, Paste, INI >>> files or LDAP" >>> >>> >>> >>> http://projects.unbit.it/uwsgi/wiki/Example: >>> >>> >>> >>> "Flask is an amazing microframework. Deploying it on uWSGI is >>> super-fast/super-easy >>> >>> (call it myapp.py) >>> >>> from flask import Flask >>> app = Flask(__name__) >>> >>> @app.route('/') >>> def hello_world(): >>> return "Hello World!" >>> >>> if __name__ == '__main__': >>> app.run() >>> >>> ./uwsgi -s /tmp/mysock.sock --module myapp --callable app" >>> >>> >>> >>> >>> I'm going to check this out tomorrow night. I just wanted to let the >>> list know, in case there are oversimplifications or errors in the >>> config... >>> >> >> > > > -- > "A arrogância é a arma dos fracos." > > =========================== > Italo Moreira Campelo Maia > Graduado em Ciência da Computação - UECE > Desenvolvedor WEB e Desktop (Java, Python, Lua) > Coordenador do Pug-CE > ----------------------------------------------------- > http://www.italomaia.com/ > http://twitter.com/italomaia/ > http://eusouolobomau.blogspot.com/ > ----------------------------------------------------- > turtle linux 910 - http://tiny.cc/blogturtle910 > =========================== >
Looks interesting. What it really needs, going through that article, is proper up-to-date packaging (apt-get or equivalent). I'd hate to go through all that rigmarole on a production server. On 15 September 2010 12:43, bruce bushby <bruce.bushby@googlemail.com> wrote: > > Sometimes the benchmark is difficult to read, moving your mouse over the > legend will highlight the graph data. > > > On Wed, Sep 15, 2010 at 12:35 PM, Italo Maia <italo.maia@gmail.com> wrote: >> >> I use uwsgi too. My config with it is very simliar to yours Eugen. Works >> like a charm. I use it behind a cherokee server. A nice tip would be to >> create a upstart script to init the uwsgi script. See this: >> http://www.westphahl.net/blog/2010/4/8/running-django-nginx-and-uwsgi/ >> >> This benchmark is really eyecandy. It made me wonder if i should migrate >> to fapws3 or gevent. But, with uwsgi, those three seem like the fastest. >> >> 2010/9/15 bruce bushby <bruce.bushby@googlemail.com> >>> >>> Could I ask why you chose uwsgi? >>> I've been struggling to make a selection from the myriad of wsgi servers >>> available, I've been using gunicorn because it's so easy to use. Looking at >>> these benchmarks, gevent appears to have an >>> edge: http://nichol.as/benchmark-of-python-web-servers >>> >>> >>> >>> >>> On Wed, Sep 15, 2010 at 5:12 AM, kevin beckford <chiggsy@lazyweb.ca> >>> wrote: >>>> >>>> They are having some hiccups now, but so far my contender for WSGI >>>> servers is uwsgi: >>>> >>>> http://projects.unbit.it/uwsgi contains the feature set, most notably: >>>> >>>> "static configuration option based on xml files, pure-python module >>>> using ApplicationsDict, wsgi file, environment variables, Paste, INI >>>> files or LDAP" >>>> >>>> >>>> >>>> http://projects.unbit.it/uwsgi/wiki/Example: >>>> >>>> >>>> >>>> "Flask is an amazing microframework. Deploying it on uWSGI is >>>> super-fast/super-easy >>>> >>>> (call it myapp.py) >>>> >>>> from flask import Flask >>>> app = Flask(__name__) >>>> >>>> @app.route('/') >>>> def hello_world(): >>>> return "Hello World!" >>>> >>>> if __name__ == '__main__': >>>> app.run() >>>> >>>> ./uwsgi -s /tmp/mysock.sock --module myapp --callable app" >>>> >>>> >>>> >>>> >>>> I'm going to check this out tomorrow night. I just wanted to let the >>>> list know, in case there are oversimplifications or errors in the >>>> config... >>> >> >> >> >> -- >> "A arrogância é a arma dos fracos." >> >> =========================== >> Italo Moreira Campelo Maia >> Graduado em Ciência da Computação - UECE >> Desenvolvedor WEB e Desktop (Java, Python, Lua) >> Coordenador do Pug-CE >> ----------------------------------------------------- >> http://www.italomaia.com/ >> http://twitter.com/italomaia/ >> http://eusouolobomau.blogspot.com/ >> ----------------------------------------------------- >> turtle linux 910 - http://tiny.cc/blogturtle910 >> =========================== > >
On Wed, Sep 15, 2010 at 5:15 AM, Dan Jacob <danjac354@gmail.com> wrote: > Looks interesting. What it really needs, going through that article, > is proper up-to-date packaging (apt-get or equivalent). I'd hate to go > through all that rigmarole on a production server. you can point pip directly at the tarball apparently, I hope to get to this tonight...
Looking at the uwsgi docs, it seems to be bundled with nginx 0.8.4 and Cherokee, so maybe just a matter of waiting :-) On 15 September 2010 13:15, Dan Jacob <danjac354@gmail.com> wrote: > Looks interesting. What it really needs, going through that article, > is proper up-to-date packaging (apt-get or equivalent). I'd hate to go > through all that rigmarole on a production server. > > On 15 September 2010 12:43, bruce bushby <bruce.bushby@googlemail.com> wrote: >> >> Sometimes the benchmark is difficult to read, moving your mouse over the >> legend will highlight the graph data. >> >> >> On Wed, Sep 15, 2010 at 12:35 PM, Italo Maia <italo.maia@gmail.com> wrote: >>> >>> I use uwsgi too. My config with it is very simliar to yours Eugen. Works >>> like a charm. I use it behind a cherokee server. A nice tip would be to >>> create a upstart script to init the uwsgi script. See this: >>> http://www.westphahl.net/blog/2010/4/8/running-django-nginx-and-uwsgi/ >>> >>> This benchmark is really eyecandy. It made me wonder if i should migrate >>> to fapws3 or gevent. But, with uwsgi, those three seem like the fastest. >>> >>> 2010/9/15 bruce bushby <bruce.bushby@googlemail.com> >>>> >>>> Could I ask why you chose uwsgi? >>>> I've been struggling to make a selection from the myriad of wsgi servers >>>> available, I've been using gunicorn because it's so easy to use. Looking at >>>> these benchmarks, gevent appears to have an >>>> edge: http://nichol.as/benchmark-of-python-web-servers >>>> >>>> >>>> >>>> >>>> On Wed, Sep 15, 2010 at 5:12 AM, kevin beckford <chiggsy@lazyweb.ca> >>>> wrote: >>>>> >>>>> They are having some hiccups now, but so far my contender for WSGI >>>>> servers is uwsgi: >>>>> >>>>> http://projects.unbit.it/uwsgi contains the feature set, most notably: >>>>> >>>>> "static configuration option based on xml files, pure-python module >>>>> using ApplicationsDict, wsgi file, environment variables, Paste, INI >>>>> files or LDAP" >>>>> >>>>> >>>>> >>>>> http://projects.unbit.it/uwsgi/wiki/Example: >>>>> >>>>> >>>>> >>>>> "Flask is an amazing microframework. Deploying it on uWSGI is >>>>> super-fast/super-easy >>>>> >>>>> (call it myapp.py) >>>>> >>>>> from flask import Flask >>>>> app = Flask(__name__) >>>>> >>>>> @app.route('/') >>>>> def hello_world(): >>>>> return "Hello World!" >>>>> >>>>> if __name__ == '__main__': >>>>> app.run() >>>>> >>>>> ./uwsgi -s /tmp/mysock.sock --module myapp --callable app" >>>>> >>>>> >>>>> >>>>> >>>>> I'm going to check this out tomorrow night. I just wanted to let the >>>>> list know, in case there are oversimplifications or errors in the >>>>> config... >>>> >>> >>> >>> >>> -- >>> "A arrogância é a arma dos fracos." >>> >>> =========================== >>> Italo Moreira Campelo Maia >>> Graduado em Ciência da Computação - UECE >>> Desenvolvedor WEB e Desktop (Java, Python, Lua) >>> Coordenador do Pug-CE >>> ----------------------------------------------------- >>> http://www.italomaia.com/ >>> http://twitter.com/italomaia/ >>> http://eusouolobomau.blogspot.com/ >>> ----------------------------------------------------- >>> turtle linux 910 - http://tiny.cc/blogturtle910 >>> =========================== >> >> >
I just want to you infrom about my experiences with setting up uwsgi
0.9.6, flask and virtualenv.
The command "./uwsgi -s /tmp/mysock.sock --module myapp --callable
app" may work but I found that in combination with a virtualenv a
command like this works well:
/usr/bin/uwsgi -s 127.0.0.1:34340 -t 10 -M -p 1 -C --wsgi-file
/your/path/example.wsgi
Note the parameter --wsgi-file which is apparently new in 0.9.6. And
inside the wsgi file you should have something like this:
site.addsitedir("/your/path/env/lib/python2.5/site-packages")
BASE_DIR = os.path.join(os.path.dirname(__file__))
sys.path.append(BASE_DIR)
in order to make your flask application work with a virtualenv. Now, I
know there is the --home parameter to set the virtualenv on the
command line with uwsgi so you could save the extra code inside the
wsgi file. However, in my setup, it didn't work.
On Wed, Sep 15, 2010 at 6:12 AM, kevin beckford <chiggsy@lazyweb.ca> wrote:
> They are having some hiccups now, but so far my contender for WSGI
> servers is uwsgi:
>
> http://projects.unbit.it/uwsgi contains the feature set, most notably:
>
> "static configuration option based on xml files, pure-python module
> using ApplicationsDict, wsgi file, environment variables, Paste, INI
> files or LDAP"
>
>
>
> http://projects.unbit.it/uwsgi/wiki/Example:
>
>
>
> "Flask is an amazing microframework. Deploying it on uWSGI is
> super-fast/super-easy
>
> (call it myapp.py)
>
> from flask import Flask
> app = Flask(__name__)
>
> @app.route('/')
> def hello_world():
> return "Hello World!"
>
> if __name__ == '__main__':
> app.run()
>
> ./uwsgi -s /tmp/mysock.sock --module myapp --callable app"
>
>
>
>
> I'm going to check this out tomorrow night. I just wanted to let the
> list know, in case there are oversimplifications or errors in the
> config...
>