[uWSGI] The key values to do good benchmark

Roberto De Ioris roberto at unbit.it
Tue Dec 29 14:56:14 CET 2009

Hi all, as every aspect of the socket communication of uWSGI is
configurable, doing good benchmark is very hard.

The default values of uWSGI are very low, as it must kill all the
potentially dangerous requests.

Expecially on evented webservers (as cherokee and nginx) the number of
requests could be huge, and soon or later uWSGI will start
"self-healing", rejecting slow-connections.

On non-evented/async server like apache, it will be very hard to reach
the limit of uWSGI. Probably apache will die first...

So i will focus on evented/async environments.

First of all the backlog queue of the server socket of uWSGI is limited
(by default) to 64 connections.

A heavy benchmark (as the one done by Yann) will reach this limit soon,
so the first value to increase is this one. (its max value is system
dependent, but 128 should be a good compromise)

The next value is the socket timeout. If a request does not send data to
the uWSGI server in the timeslice specified by the timeout, the request
will be rejected. By default this timeout is 4 seconds. Feel free to
maximize this value to very high values (remebering that could lead to
a security/DOS problem).

Then the harakiri will come...

Disable it on every benchmark !!! Its work is to block slow operations,
and when the system is high-loaded every action is slow.

I have done a little benchmark a couple a minute ago with this options:

./uwsgi26 -s -i -H /home/roberto/Desktop/djangoCMS -M -p
10 -w cms_wsgi -z 30 -l 120 2>/dev/null

look at the -i (it will disable multiple-interpreters exchange) and the
logging redirection to /dev/null as loggin is overkill on high-loade

Probably we will add a new flag that will maintain logging only for

Hope this will be useful for your tests.

Roberto De Ioris
JID: roberto at jabber.unbit.it

More information about the uWSGI mailing list