{"id":1008,"date":"2009-11-29T20:56:00","date_gmt":"2009-11-29T12:56:00","guid":{"rendered":"\/?p=1008"},"modified":"2009-11-29T20:56:00","modified_gmt":"2009-11-29T20:56:00","slug":"1008","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1008.html","title":{"rendered":"Varnish vs Squid"},"content":{"rendered":"
\u5bf9\u4e8e\u574a\u95f4\u6d41\u4f20\u7684: \u5e73\u53f0: WEB: CLIENT: SWITCH: 1.Squid 2.6 \u914d\u7f6e\u6587\u4ef6<\/p>\n 2.Squid 3.0 \u914d\u7f6e\u6587\u4ef6<\/p>\n 3.Varnish 1.1.2 \u914d\u7f6e\u6587\u4ef6<\/p>\n \u8fd0\u884c\u53c2\u6570<\/p>\n 4.Nginx 0.6.31 \u914d\u7f6e\u6587\u4ef6<\/p>\n
1.varnish\u7684\u6027\u80fd\u6bd4squid\u9ad810~20\u500d
2.squid 3.0\u7684\u6027\u80fd\u6bd42.6\u6709\u63d0\u9ad8
\u672c\u6b21\u6d4b\u8bd5\u5c06\u4f1a\u63ed\u793a\u7ed3\u679c,
\u662f\u5426varnish\u7684\u67b6\u6784\u771f\u7684\u80fd\u63d0\u5347\u90a3\u4e48\u591a\u7684\u6027\u80fd
\u662f\u5426squid\u7684\u65b0\u7248\u672c\u5728\u6027\u80fd\u4e0a\u6709\u6240\u63d0\u5347
\u6d4b\u8bd5\u4e2d\u5c06\u4e0d\u5bf9\u5e73\u53f0.\u8f6f\u4ef6.\u7b49\u7b49\u8fdb\u884c\u4f18\u5316
\u7531\u4e8e\u4f18\u5316\u6c34\u5e73\u7684\u5173\u7cfb\u5c06\u6781\u5927\u7684\u5f71\u54cd\u7ed3\u679c.
\u6b64\u6b21\u6d4b\u8bd5\u4e2d\u7684\u6570\u636e\u53ef\u4ee5\u4f5c\u4e3a\u57fa\u51c6\u6570\u636e.
\u53ef\u4ee5\u7531\u5176\u4e2d\u4e2a\u522b\u8f6f\u4ef6\u7684\u4f18\u5316\u4e0e\u975e\u4f18\u5316\u7ed3\u679c\u6bd4\u4f8b\u7cfb\u6570
\u81ea\u884c\u8ba1\u7b97\u5f97\u51fa\u6bd4\u8f83\u7ed3\u679c.\u6240\u4ee5\u4e2a\u522b\u8f6f\u4ef6\u7684\u4f18\u5316\u6216\u8005\u7cfb\u7edf\u4f18\u5316\u540e\u5bf9\u6574\u4f53\u7684\u5f71\u54cd
\u53ef\u4ee5\u7531\u8bfb\u8005\u81ea\u884c\u5bf9\u7279\u5b9a\u8f6f\u4ef6\u8fdb\u884c,\u5e76\u4f7f\u7528\u6b64\u57fa\u51c6\u6570\u636e\u8fdb\u884c\u63a8\u7b97.
WEB\u7ad9\u70b9\u7684\u9875\u9762
\u6211\u5c06\u6dd8\u5b9d\u7684\u9996\u9875\u83b7\u53d6\u5230\u672c\u5730
\u4f5c\u4e3a\u6d4b\u8bd5\u5bf9\u8c61
\u6d4b\u8bd5\u9875\u9762\u4e0b\u8f7d
index_files<\/font><\/a><\/p>\n
PROXY:
CentOS 5.1 \u6700\u5c0f\u5316\u5b89\u88c5
\u6d6a\u6f6eNF190
Xeon 2.8
1G RAM
73G SCSI
Squid 2.6,Squid 3.0,Varnish 1.1.2<\/p>\n
CentOS 5.1 \u6700\u5c0f\u5316\u5b89\u88c5
\u6d6a\u6f6eNF180
Xeon 2.8
1G RAM
73G SCSI
Nginx 0.6.31<\/p>\n
CentOS 5.1 \u6700\u5c0f\u5316\u5b89\u88c5
\u6d6a\u6f6eNF260
Xeon 2.4
512M RAM
36G SCSI
http_load-12mar2006<\/p>\n
DLINK DES 1024R+<\/p>\n
\u7f16\u8bd1\u53c2\u6570<\/p>\n
<\/span>http_port<\/span> <\/span>80<\/span> <\/span>accel<\/span> <\/span>vhost<\/span> <\/span>vport<\/span>
<\/span>cache_peer<\/span> <\/span>192.168.210.111<\/span> <\/span>parent<\/span> <\/span>80<\/span> <\/span>0<\/span> <\/span>no<\/span>–<\/span>query<\/span> <\/span>originserver<\/span> <\/span>name<\/span>=<\/span>test1<\/span>
<\/span>acl<\/span> <\/span>all<\/span> <\/span>src<\/span> <\/span>0.0.0.0<\/span>\/<\/span>0.0.0.0<\/span>
<\/span>http_access<\/span> <\/span>allow<\/span> <\/span>all<\/span>
<\/span>cache_log<\/span> \/<\/span>var<\/span>\/<\/span>log<\/span>\/<\/span>squid26<\/span>\/<\/span>cache<\/span>.<\/span>log<\/span><\/div>\n<\/div>\n
\u7f16\u8bd1\u53c2\u6570<\/p>\n
<\/span>http_port<\/span> <\/span>80<\/span> <\/span>accel<\/span> <\/span>vhost<\/span> <\/span>vport<\/span>
<\/span>cache_peer<\/span> <\/span>192.168.210.111<\/span> <\/span>parent<\/span> <\/span>80<\/span> <\/span>0<\/span> <\/span>no<\/span>–<\/span>query<\/span> <\/span>originserver<\/span> <\/span>name<\/span>=<\/span>test1<\/span>
<\/span>acl<\/span> <\/span>all<\/span> <\/span>src<\/span> <\/span>0.0.0.0<\/span>\/<\/span>0.0.0.0<\/span>
<\/span>http_access<\/span> <\/span>allow<\/span> <\/span>all<\/span>
<\/span>cache_log<\/span> \/<\/span>var<\/span>\/<\/span>log<\/span>\/<\/span>squid30<\/span>\/<\/span>cache<\/span>.<\/span>log<\/span><\/div>\n<\/div>\n
\u7f16\u8bd1\u53c2\u6570<\/p>\n
<\/span>set<\/span> <\/span>backend<\/span>.<\/span>host<\/span> = <\/span>"<\/span>192.168.210.111<\/span>"<\/span>;
<\/span>set<\/span> <\/span>backend<\/span>.<\/span>port<\/span> = <\/span>"<\/span>80<\/span>"<\/span>;
<\/span>}<\/span><\/div>\n<\/div>\n
\u7f16\u8bd1\u53c2\u6570<\/p>\n
<\/span>events<\/span> <\/span>{<\/span>
<\/span>worker_connections<\/span><\/span>1024<\/span>;
<\/span>}<\/span>
<\/span>http<\/span> <\/span>{<\/span>