硬件环境Dell 1950,E5410X2,16G
原先在使用centos 5.3 x64,内核版本为2.6.18-128.el5,在部署tomcat后,用ab做压力测试,大概有8000/s的吞吐量。
最近升级内核到2.6.35.4,同样用ab和webbench测试一下,结果如下
[root@OS90 webbench-1.5]# ab -c 1000 -n 20000 http://192.168.0.8:8080/examples/servlets/servlet/HelloWorldExample
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.0.8 (be patient)
Completed 2000 requests
Completed 4000 requests
Completed 6000 requests
Completed 8000 requests
Completed 10000 requests
Completed 12000 requests
Completed 14000 requests
Completed 16000 requests
Completed 18000 requests
Finished 20000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: 192.168.0.8
Server Port: 8080
Document Path: /examples/servlets/servlet/HelloWorldExample
Document Length: 359 bytes
Concurrency Level: 1000
Time taken for tests: 1.479021 seconds
Complete requests: 20000
Failed requests: 0
Write errors: 0
Total transferred: 10597314 bytes
HTML transferred: 7503818 bytes
Requests per second: 13522.46 [#/sec] (mean)
Time per request: 73.951 [ms] (mean)
Time per request: 0.074 [ms] (mean, across all concurrent requests)
Transfer rate: 6996.52 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 30 17.9 30 64
Processing: 27 39 7.7 39 72
Waiting: 0 14 8.2 14 64
Total: 28 69 23.2 70 134
Percentage of the requests served within a certain time (ms)
50% 70
66% 82
75% 89
80% 94
90% 102
95% 106
98% 109
99% 110
100% 134 (longest request)
测试HelloWorld servlet,大概有每秒1.3万
用webbench测试
[root@OS90 webbench-1.5]# ./webbench -c 5000 -t 60 http://192.168.0.8:8080/examples/servlets/servlet/HelloWorldExample
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://192.168.0.8:8080/examples/servlets/servlet/HelloWorldExample
5000 clients, running 60 sec.
Speed=1694961 pages/min, 14303044 bytes/sec.
Requests: 1692407 susceed, 2554 failed.
由于webbench是多线程,数据更准确些
性能提升比较显著
另外升级的目的主要是原先haproxy的能力较弱,1.2万/s,升级后大概在1.8万/s,虽不满意,但性能提升还是可见的。haproxy还有优化空间。