[uWSGI] To --single-interpreter or not

Roberto De Ioris roberto at unbit.it
Sat Apr 17 08:58:30 CEST 2010


Il giorno ven, 16/04/2010 alle 13.14 +0100, Peter Bengtsson ha scritto:

> So I've deployed it on 3 different sites. All separate Ubuntu servers
> and all completely separate applications. What they all have in common
> is that they're Django (Python 2.5) fronted by Nginx.
> 
> One of the sites (the one that uses MongoDB instead of PostgreSQL)
> started becoming ultra ultra slow. After some testing and tweaking I
> concluded that it was because it wasn't running in
> --single-interpreter mode. Switching to that made the site work
> happily again. Questions:
> 
> 1. How much slower is --single-interpreter?


Hi Peter, that's a good question but hard to answer. Multiple
interpreters are cool but there are reports on some c extension that do
not cooperate well with them. That's why there are three exclamation
marks 

When multiple interpreters are enabled, uWSGI will change the whole
ThreadState (an internal python structure) at every request. It is not
so slow but with some kind of app/extensions that could be overkill.

If you are using a 0.9.5* release you can add

<single-interpreter/> 

to the xml file.

Could you send a benchmark (add to it all the module you use in your
app) with the difference from multi to single mode ? (a simple ab output
is sufficient)

Thanks a lot

-- 
Roberto De Ioris <roberto at unbit.it>
Unbit



More information about the uWSGI mailing list