IT流言终结者1续篇:varnish vs squid
update: 2008-06-11 squid 2.7由于网络关系在上次测试中表现不理想,后来在每次测试后均...
扫描右侧二维码阅读全文
11
2008/06

IT流言终结者1续篇:varnish vs squid

update:
2008-06-11 squid 2.7由于网络关系在上次测试中表现不理想,后来在每次测试后均重启服务器和交换机.得出的结果更加准确一点

这次测试使用http_load的fetches参数进行
测试环境与上次相同
首先是varnish 1.1.2的测试结果

[root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 28.9272 seconds 223782 mean bytes/connection 34.5695 fetches/sec, 7.73603e+06 bytes/sec msecs/connect: 293.744 mean, 20995.7 max, 0.23 min msecs/first-response: 116.243 mean, 1237.96 max, 0.717 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 28.6097 seconds 223782 mean bytes/connection 34.9532 fetches/sec, 7.8219e+06 bytes/sec msecs/connect: 233.996 mean, 20995.2 max, 0.145 min msecs/first-response: 126.736 mean, 904.133 max, 0.722 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 26.1125 seconds 223782 mean bytes/connection 38.2959 fetches/sec, 8.56993e+06 bytes/sec msecs/connect: 201.495 mean, 20994.7 max, 0.132 min msecs/first-response: 163.002 mean, 2020.39 max, 0.727 min HTTP response codes: code 200 -- 1000

varnish的表现一直很稳定
也没有出错
虽然服务数比squid 2.6要少
但是毕竟还是保持在一定水平

接下来是squid 2.6的测试结果

[root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 23.5692 seconds 223782 mean bytes/connection 42.4282 fetches/sec, 9.49467e+06 bytes/sec msecs/connect: 715.485 mean, 21006 max, 0.184 min msecs/first-response: 97.5936 mean, 891.699 max, 0.986 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 21.9795 seconds 223782 mean bytes/connection 45.497 fetches/sec, 1.01814e+07 bytes/sec msecs/connect: 377.884 mean, 20995.4 max, 0.228 min msecs/first-response: 116.212 mean, 3596.57 max, 0.977 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 22.6211 seconds 223782 mean bytes/connection 44.2065 fetches/sec, 9.89261e+06 bytes/sec msecs/connect: 653.928 mean, 20995.9 max, 0.199 min msecs/first-response: 107.634 mean, 1597.88 max, 0.988 min HTTP response codes: code 200 -- 1000

squid 2.6的表现令人非常满意
高服务数以及稳定的服务结果

squid 2.7

[root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 23.8515 seconds 223782 mean bytes/connection 41.9261 fetches/sec, 9.38231e+06 bytes/sec msecs/connect: 583.364 mean, 21000.4 max, 0.211 min msecs/first-response: 94.2072 mean, 1280.54 max, 0.715 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 24.2255 seconds 223782 mean bytes/connection 41.2788 fetches/sec, 9.23745e+06 bytes/sec msecs/connect: 224.308 mean, 9031.01 max, 0.201 min msecs/first-response: 123.128 mean, 4906.25 max, 0.725 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 23.9704 seconds 223782 mean bytes/connection 41.7182 fetches/sec, 9.33578e+06 bytes/sec msecs/connect: 235.831 mean, 20994.9 max, 0.162 min msecs/first-response: 213.081 mean, 14413.7 max, 0.494 min HTTP response codes: code 200 -- 1000

由于上次测试网络设备和服务器本身测试过久的关系
导致错误率很高.
重新测试后
2.7的表现比较稳定
虽然服务能力不及2.6
但是在内存占用率以及CPU占用率方面有着相当优势

squid 3.0

[root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 24.5945 seconds 223782 mean bytes/connection 40.6594 fetches/sec, 9.09885e+06 bytes/sec msecs/connect: 300.582 mean, 20994.9 max, 0.164 min msecs/first-response: 76.3194 mean, 874.92 max, 0.975 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 27.2884 seconds 223782 mean bytes/connection 36.6456 fetches/sec, 8.20062e+06 bytes/sec msecs/connect: 236.186 mean, 20995.2 max, 0.188 min msecs/first-response: 129.001 mean, 3201.61 max, 0.992 min HTTP response codes: code 200 -- 1000 [root@test3 http_load-12mar2006]# ./http_load -parallel 200 -fetches 1000 urls 1000 fetches, 200 max parallel, 2.23782e+08 bytes, in 21.9625 seconds 223782 mean bytes/connection 45.5321 fetches/sec, 1.01893e+07 bytes/sec msecs/connect: 281.044 mean, 9032.06 max, 0.156 min msecs/first-response: 131.911 mean, 15306.7 max, 0.982 min HTTP response codes: code 200 -- 1000

squid 3.0的表现出乎我意料
原本以为会比suqid 2.7更不稳定
结果在不停的测试了10次之后
依然没有和2.7那样出错
只是其性能表现不是很稳定
最高峰到达49f/s,而最低在31f/s

在特定访问数的情况下
squid 2.6比varnish 1.1.2性能更好
参照上次测试结果可以得出
在服务器的刚开始时(前10秒内)varnish的反应速度比squid要快
之后速度下降,最终保持一个稳定值

结论:
1.squid 2.6性能比varnish 要好.

Last modification:November 26th, 2018 at 04:16 pm
If you think my article is useful to you, please feel free to appreciate

2 comments

  1. jason

    谢谢了

  2. Michael Field

    Johnny 测试辛苦啦~
    最近发的blog都很有看头~
    给实际应用发挥积极借鉴作用~

    最近忙着换工作的事情,让兄弟一人顶着啦~
    呵呵~~
    歹势歹势歹势

Leave a Comment