Here you will find some benchmarks that should help you to make a decision whether to use FAPWS3 or to stay with your current webserver.
Nicolas (Benchmark of python web servers) has performed a quite complete comparison between different WSGI servers. Toegether with Gevent, Fapws3 is amongst the top perfomer. This is nice because you have now the choice between libevent (used by gevent) and libev (used by Fapws3).
Methodology to use before sending me your results
Benchmarking is not a so easy task. We have to be very careful with what we are doing and what could be the conclusions.
Thus before sending me results, thanks to provide the environment in which you are running your tests. For exmaple:
- Operating system
- Benchmark tool
- Python version
- Libev version
If you run Fapws3 (webserver) and the client (ApacheBench, "ab" in short) on the same host; thanks to re-nice ab: "nice -n20". Wait enough time between each run to assure all "waiting" connections (displayed by netstat) will be effectively closed (+- 1 minute on my machine). Execute each tests 3 times and take one "ab" report which is representative.
Fapws3 versus gevent
Freebsd -8.0 stable poll backend python 2.6 libev-2.8 Fapws-0.4-dev gevent-0.12 greenlet-0.2 ApacheBench-2.3
- For gevent, I've used the wsgiserver.py script provided on the sample directory hosted by google.
To avoid performance delta due to the printouts, I've redirected them to the /dev/null:
python test_gevent.py > /dev/null
- I've used the "hello world" sample provided (debug mode deasabled)
The webservers and ApacheBenchmark tool were running on the same host by using the
nice -n10 ab .... Every measure was made 3x with a sufficiant delay between each of them to assure open sockets will be closed before the next run (netstat -a).
Fapws3 is about 56% quicker than Gevent.
I've got issues to run more than 5 concurrent request with Gevent (strange)
|1 concurrent request||6065#/sec||3843#/sec|
|5 concurrent requests||6168#/sec||4807#/sec|
|10 concurrent requests||6290#/sec||error|
|15 concurrent requests||6274#/sec||error|
|20 concurrent requests||6401#/sec||error|
Fapws3 versus Lua Xavante
Linux kubuntu 2.6.32-21-generic #32-Ubuntu SMP Epoll backend python-2.6.5 Fapws3-0.7 Lua-5.1.4 Xavante-1.3.4
Since I've no knowledge of Lua, I'll stick to the simplest test: serving a static file.For Lua-Xavante:
- Start the default wsapi
- create a simple index.html file with the famous "Hello world"
- USe the short text of the hello_world sample
- As usual use the ApacheBenchmark tool running on the same host by using the "nice -n10 ab ..."
- tests have been executed 3x for each servers
- tests with 10000 requests
Fapws3 is about 2.5x faster !!!
BUT Lua takes 2x less resources in memory: 1944KB for Lua and 4760KB for Fapws3
|1 concurrent request||3919#/sec||2101#/sec|
|5 concurrent requests||4759#/sec||2032#/sec|
|10 concurrent requests||4906#/sec||2149#/sec|
|20 concurrent requests||6402#/sec||2363#/sec|
|50 concurrent requests||7585#/sec||1920#/sec|