-
Notifications
You must be signed in to change notification settings - Fork 74
Golanger Using Apache Bench for Simple Load Testing
border edited this page Sep 14, 2012
·
5 revisions
- Dell XPS 14z
- 4 Core Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
- Linux kvbian 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
- MemTotal: 4G
- 测试程序和被测试程序都在同一台机器上运行
- Helloworld 支持session和模板渲染(index.html此页会对session写入数据)
- website 只输出Helloworld字符串
|------------+-------------------+------------------------|
| 应用 | 参数 | RPS |
|------------+-------------------+------------------------|
| Helloworld | -c 10000 -n 10000 | 5664.07 [#/sec] (mean) |
| | -c 10000 -n 10000 | 5427.03 [#/sec] (mean) |
| | -c 10000 -n 10000 | 5648.67 [#/sec] (mean) |
|------------+-------------------+------------------------|
| website | -c 10000 -n 10000 | 8685.44 [#/sec] (mean) |
| | -c 10000 -n 10000 | 8525.31 [#/sec] (mean) |
| | -c 10000 -n 10000 | 8872.91 [#/sec] (mean) |
|------------+-------------------+------------------------|
测试 Helloworld 程序
ab -c 10000 -n 10000 http://127.0.0.1:8080/
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8082
Document Path: /
Document Length: 2981 bytes
Concurrency Level: 10000
Time taken for tests: 1.766 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 31660000 bytes
HTML transferred: 29810000 bytes
Requests per second: 5664.07 [#/sec] (mean)
Time per request: 1765.516 [ms] (mean)
Time per request: 0.177 [ms] (mean, across all concurrent requests)
Transfer rate: 17512.14 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 99 50.1 119 146
Processing: 1 789 415.4 788 1611
Waiting: 1 781 406.0 786 1589
Total: 3 888 423.1 853 1752
Server Hostname: 127.0.0.1
Server Port: 8082
Document Path: /
Document Length: 2981 bytes
Concurrency Level: 10000
Time taken for tests: 1.843 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 31660000 bytes
HTML transferred: 29810000 bytes
Requests per second: 5427.03 [#/sec] (mean)
Time per request: 1842.628 [ms] (mean)
Time per request: 0.184 [ms] (mean, across all concurrent requests)
Transfer rate: 16779.28 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 72 59.2 114 157
Processing: 3 475 309.0 446 1606
Waiting: 3 469 309.0 443 1578
Total: 3 547 329.5 500 1724
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8082
Document Path: /
Document Length: 2981 bytes
Concurrency Level: 10000
Time taken for tests: 1.770 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 31660000 bytes
HTML transferred: 29810000 bytes
Requests per second: 5648.67 [#/sec] (mean)
Time per request: 1770.328 [ms] (mean)
Time per request: 0.177 [ms] (mean, across all concurrent requests)
Transfer rate: 17464.54 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 82 60.6 115 160
Processing: 1 601 364.4 561 1618
Waiting: 1 596 364.7 560 1605
Total: 1 683 378.2 622 1748
测试 website 程序
ab -c 10000 -n 10000 http://127.0.0.1:8080/
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 61 bytes
Concurrency Level: 10000
Time taken for tests: 1.151 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1770000 bytes
HTML transferred: 610000 bytes
Requests per second: 8685.44 [#/sec] (mean)
Time per request: 1151.352 [ms] (mean)
Time per request: 0.115 [ms] (mean, across all concurrent requests)
Transfer rate: 1501.29 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 61 117 22.4 123 167
Processing: 81 420 204.2 399 951
Waiting: 28 387 203.4 370 915
Total: 150 537 201.8 515 1085
Server Software:
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 61 bytes
Concurrency Level: 10000
Time taken for tests: 1.173 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1770000 bytes
HTML transferred: 610000 bytes
Requests per second: 8525.31 [#/sec] (mean)
Time per request: 1172.978 [ms] (mean)
Time per request: 0.117 [ms] (mean, across all concurrent requests)
Transfer rate: 1473.61 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 42 130 26.6 136 191
Processing: 80 455 211.4 449 995
Waiting: 36 419 210.6 414 954
Total: 132 586 209.9 578 1131
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /
Document Length: 61 bytes
Concurrency Level: 10000
Time taken for tests: 1.127 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1770000 bytes
HTML transferred: 610000 bytes
Requests per second: 8872.91 [#/sec] (mean)
Time per request: 1127.026 [ms] (mean)
Time per request: 0.113 [ms] (mean, across all concurrent requests)
Transfer rate: 1533.70 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 33 122 27.0 129 160
Processing: 75 444 204.9 420 937
Waiting: 51 419 208.3 396 932
Total: 138 566 208.2 533 1070