根据博客里varnish缓存服务器和nginx缓存服务器为基础,硬件配置一样
varnish缓存服务器
[root@1 ~]# ab -t 60 -c 1024 http://192.168.2.4:80/
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.2.4 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Finished 36719 requests
Server Software: Apache/2.2.3
Server Hostname: 192.168.2.4
Server Port: 80
Document Path: /
Document Length: 89854 bytes
Concurrency Level: 1024
Time taken for tests: 60.437 seconds
Complete requests: 36719
Failed requests: 0
Write errors: 0
Total transferred: -982848748 bytes
HTML transferred: -995610426 bytes
Requests per second: 611.98 [#/sec] (mean)
Time per request: 1673.260 [ms] (mean)
Time per request: 1.634 [ms] (mean, across all concurrent requests)
Transfer rate: -15996.77 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 72.1 0 3002
Processing: 284 1643 233.2 1648 10718
Waiting: 166 1639 230.1 1645 10338
Total: 294 1648 239.0 1648 10726
Percentage of the requests served within a certain time (ms)
50% 1648
66% 1652
75% 1657
80% 1661
90% 1716
95% 1764
98% 1823
99% 1825
100% 10726 (longest request)
nginx缓存服务器:
[root@1 ~]# ab -t 60 -c 1024 http://192.168.2.5:80/
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.2.5 (be patient)
Finished 1238 requests
Server Software: nginx/1.1.10
Server Hostname: 192.168.2.5
Server Port: 80
Document Path: /
Document Length: 89857 bytes
Concurrency Level: 1024
Time taken for tests: 60.5164 seconds
Complete requests: 1238
Failed requests: 154
(Connect: 0, Length: 154, Exceptions: 0)
Write errors: 0
Non-2xx responses: 154
Total transferred: 132074804 bytes
HTML transferred: 131597176 bytes
Requests per second: 20.63 [#/sec] (mean)
Time per request: 49632.705 [ms] (mean)
Time per request: 48.469 [ms] (mean, across all concurrent requests)
Transfer rate: 2149.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 45 211.4 0 2999
Processing: 320 18262 15034.7 12215 59456
Waiting: 53 10367 12076.7 6160 54764
Total: 320 18307 15057.5 12276 59617
Percentage of the requests served within a certain time (ms)
50% 12276
66% 19588
75% 26672
80% 32030
90% 42350
95% 51591
98% 56463
99% 57918
100% 59617 (longest request)
测试结果:varnish强大好多,但不知道是不是nginx优化的不够好,nginx也是很强大的,但测试的效果怎么会如此?。。。。。