| william_os4y ( @ 2006-01-20 22:19:00 |
Threaded versus Event-based web servers
Thus, Tests were made with the nice command: nice -n 20 ab2 -n10000 -c100 http://localhost/
Annexe:
CherryPy config was:
For the others, the config is the standard one (not modifications).
To continue with python webserver tests, I've got the idea compared threaded versus event-based solutions.
If you read the c10k problem, you can see that threaded webservers resists less to a massive concurrent DoS.
I've decided to compare CherryPy, Twisted.web2, Apricot and Asynchronous HTTP with a simple static file.
Every tests have been made localy (webserver and benchmark on the same machine).Thus, Tests were made with the nice command: nice -n 20 ab2 -n10000 -c100 http://localhost/
| WebServer | Concurrent | Requests per second |
|---|---|---|
| CherryPy | 1 | 225 |
| Twisted.web2 | 1 | 312 |
| Apricot | 1 | 856 |
| Asynchronous HTTP | 1 | 432 |
| CherryPy | 100 | 234 |
| Twisted.web2 | 100 | 429 |
| Apricot | 100 | 1057 |
| Asynchronous HTTP | 100 | 411 |
| CherryPy | 500 | 194 |
| Twisted.web2 | 500 | 391 |
| Apricot | 500 | 885 |
| Asynchronous HTTP | 500 | 308 |
More intersting, we see that event based webservers resist much more to DoS (500 concurrent request) attacks.
| WebServer | Percentage of the requests served within a certain time (ms) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| CherryPy |
|
|||||||||
| Twisted.web2 |
|
|||||||||
| Apricot |
|
|||||||||
| Asynchronous HTTP |
|
Annexe:
CherryPy config was:
[global]and all html data was directly within a local vairable (not via the static filter).
server.socketPort = 8081
server.threadPool = 10
server.environment = "production"
server.logFile = "access.log"
server.logToScreen = False
For the others, the config is the standard one (not modifications).