Zope2 Sprint
»
TestServerBenchmarks
Just for stools and smiles:
Test CGI Script
Code:
#!/usr/local/bin/python print "Content-Type: text/plain\n\n" for i in range(10): print "this is line %s" % i
Test against Apache
Command:
$ ab -n 100 -c 10 http://localhost:6969/cgi-bin/test.py
Output:
Document Length: 151 bytes Concurrency Level: 10 Time taken for tests: 22.822 seconds Complete requests: 100 Requests per second: 4.38 [#/sec] (mean) Time per request: 2282.20 [ms] (mean) Time per request: 228.22 [ms] (mean, across all concurrent requests) Transfer rate: 1.24 [Kbytes/sec] received Connnection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 2 Processing: 372 2206 439.4 2206 3623 Waiting: 371 2204 439.6 2206 3623 Total: 372 2206 439.4 2206 3623 Percentage of the requests served within a certain time (ms) 50% 2206 66% 2299 75% 2358 80% 2424 90% 2552 95% 3177 98% 3338 99% 3623 100% 3623 (last request)
Test against Twisted Server
Command:
$ ab -n 100 -c 10 http://localhost:6969/cgi-bin/test.py
Output:
Document Length: 151 bytes Concurrency Level: 10 Time taken for tests: 29.403 seconds Complete requests: 100 Requests per second: 3.40 [#/sec] (mean) Time per request: 2940.30 [ms] (mean) Time per request: 294.03 [ms] (mean, across all concurrent requests) Transfer rate: 0.88 [Kbytes/sec] received Connnection Times (ms) min mean[+/-sd] median max Connect: 0 59 414.7 0 2948 Processing: 1900 2762 264.2 2788 3375 Waiting: 1899 2762 264.3 2788 3375 Total: 1900 2821 515.8 2788 6039 Percentage of the requests served within a certain time (ms) 50% 2788 66% 2878 75% 2929 80% 2985 90% 3093 95% 3184 98% 5789 99% 6039 100% 6039 (last request)
I changed the test.py
script to output 1000 lines of text. Total file size is now 27891, and the requests per second against this new code follow.
Apache:
Requests per second: 2.96 [#/sec] (mean)
Twisted:
Requests per second: 4.05 [#/sec] (mean)
Note that twisted server started generating exceptions with 1000 line output, 100 connections, 10 simultaneous connections.