查看:3131|回复:0
Varnish,nginx,squid 反向代理,缓存的测试发表时间:2010-08-30 22:54:51

大虾

0分享0主题0帖子

学徒一级

(初出茅庐)

Varnish,nginx,squid 反向代理,缓存的测试和比较


先看一组数据,以下测试在同一台设备上,使用ab的varnish和nginx的测试结果:


Server Software: Apache/2.2.9

Server Hostname: 192.168.1.135

Server Port: 6081

Document Path: /

Document Length: 0 bytes

Concurrency Level: 1000

Time taken for tests: 1.403 seconds

Complete requests: 10000

Failed requests: 10175

(Connect: 0, Receive: 0, Length: 9452, Exceptions: 723)

Write errors: 0

Total transferred: 30293650 bytes

HTML transferred: 27183952 bytes

Requests per second: 7128.77 [#/sec] (mean)

Time per request: 140.277 [ms] (mean)

Time per request: 0.140 [ms] (mean, across all concurrent requests)

Transfer rate: 21089.51 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 18 14.0 13 93

Processing: 36 118 18.0 124 146

Waiting: 0 64 22.8 68 91

Total: 46 136 19.9 136 205

Percentage of the requests served within a certain time (ms)

50% 136

66% 139

75% 141

80% 143

90% 149

95% 179

98% 187

99% 189

100% 205 (longest request)

######################################################

Server Software: nginx/0.6.32

Server Hostname: 192.168.1.135

Server Port: 80

Document Path: /

Document Length: 2876 bytes

Concurrency Level: 1000

Time taken for tests: 1.340 seconds

Complete requests: 10000

Failed requests: 0

Write errors: 0

Total transferred: 31030000 bytes

HTML transferred: 28760000 bytes

Requests per second: 7462.39 [#/sec] (mean)

Time per request: 134.005 [ms] (mean)

Time per request: 0.134 [ms] (mean, across all concurrent requests)

Transfer rate: 22613.09 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 60 34.2 60 122

Processing: 25 71 12.0 72 91

Waiting: 1 44 25.1 45 90

Total: 89 132 24.4 131 178

Percentage of the requests served within a certain time (ms)

50% 131

66% 144

75% 152

80% 157

90% 166

95% 171

98% 174

99% 175

100% 178 (longest request)

############################################

Server Software: Apache/2.2.9

Server Hostname: 192.168.1.135

Server Port: 6081

Document Path: /img/200807/m_1.jpg

Document Length: 0 bytes

Concurrency Level: 1000

Time taken for tests: 1.527 seconds

Complete requests: 10000

Failed requests: 10000

(Connect: 0, Receive: 0, Length: 9284, Exceptions: 716)

Write errors: 0

Total transferred: 61422934 bytes

HTML transferred: 58349940 bytes

Requests per second: 6549.93 [#/sec] (mean)

Time per request: 152.673 [ms] (mean)

Time per request: 0.153 [ms] (mean, across all concurrent requests)

Transfer rate: 39288.63 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 20 16.1 14 92

Processing: 31 130 23.6 138 162

Waiting: 0 70 26.8 77 103

Total: 72 149 24.5 152 226

Percentage of the requests served within a certain time (ms)

50% 152

66% 156

75% 159

80% 161

90% 173

95% 190

98% 200

99% 208

100% 226 (longest request)

###############################################

Server Software: nginx/0.6.32

Server Hostname: 192.168.1.135

Server Port: 80

Document Path: /img/200807/m_1.jpg

Document Length: 6285 bytes

Concurrency Level: 1000

Time taken for tests: 1.366 seconds

Complete requests: 10000

Failed requests: 0

Write errors: 0

Total transferred: 64980000 bytes

HTML transferred: 62850000 bytes

Requests per second: 7319.58 [#/sec] (mean)

Time per request: 136.620 [ms] (mean)

Time per request: 0.137 [ms] (mean, across all concurrent requests)

Transfer rate: 46447.87 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 1 61 34.5 60 122

Processing: 27 73 11.7 74 91

Waiting: 1 45 25.6 45 90

Total: 91 134 24.8 134 180

Percentage of the requests served within a certain time (ms)

50% 134

66% 146

75% 155

80% 160

90% 169

95% 175

98% 177

99% 178

100% 180 (longest request)

测试可以得到几个结果:

  1. 根据Connection Times项获知

    varnish的连接速度快于nginx

    nginx处理速度快于varnish

    等待时间几乎一致,总时间nginx要快于varnish 15%左右。
  2. 根据HTML transferred项获知

    大负载下varnish存在较多的丢包问题。



您需要登录以后才可以回帖    登录|注册