{"id":1132,"date":"2011-10-25T15:45:00","date_gmt":"2011-10-25T07:45:00","guid":{"rendered":"\/?p=1132"},"modified":"2011-10-25T15:45:00","modified_gmt":"2011-10-25T15:45:00","slug":"1132","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1132.html","title":{"rendered":"Varnish\u4e0d\u91cd\u542f\u52a0\u8f7d\u65b0\u914d\u7f6e\u6587\u4ef6"},"content":{"rendered":"

 \u5047\u8bbe\u542f\u52a8\u7684varnish\u670d\u52a1\u5982\u4e0b\uff1a
.\/varnishd -f ..\/etc\/varnish\/default.vcl -s malloc,1G -T 127.0.0.1:3500<\/p>\n

\u6ce8\u610f\uff1a1. varnish\u670d\u52a1\u672c\u8eab\uff0c\u542f\u52a8\u9ed8\u8ba4\u7aef\u53e380\uff1b\u5982\u679c\u9700\u8981\u91cd\u65b0\u6307\u5b9a\u542f\u52a8\u7684\u7aef\u53e3\u4f7f\u7528 -a\u9009\u9879 ,\u5982-a 0.0.0.0:8080
           2. -T \u9009\u9879\u6307\u5b9a\u4e86varnish\u670d\u52a1\u672c\u8eab\u7684\u7ba1\u7406\u7aef\u53e3\uff0c\u6b63\u662f\u5229\u7528\u8fd9\u4e2a\u7aef\u53e3\u5b8c\u6210\u4e00\u4e9b\u4e0d\u5173\u95edvarnish\u670d\u52a1\u800c\u4f7f\u65b0\u914d\u7f6e\u751f\u6548\u3002<\/b><\/p>\n

\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/b>
1\u3001\u767b\u9646\u5230\u7ba1\u7406\u63a5\u53e3\uff1a
    >telnet 127.0.0.1 3500
    >help  (\u5229\u7528\u8be5\u547d\u4ee4\u53ef\u4ee5\u5f97\u5230\u5f88\u591a\u7684\u4fee\u6539\u5e2e\u52a9)
\u8fd4\u56de\uff1a
200 377    <\/span>
help [command]<\/span>
ping [timestamp]<\/span>
auth response<\/span>
quit<\/span>
banner<\/span>
status<\/span>
start<\/span>
stop<\/span>
stats<\/span><\/span>
vcl.load <configname> <filename><\/span>
vcl.inline <configname> <quoted_VCLstring><\/span>
vcl.use <configname><\/span>
vcl.discard <configname><\/span>
vcl.list<\/span>
vcl.show <configname><\/span>
param.show [-l] [<param>]<\/span>
param.set <param> <value><\/span>
purge.url <regexp><\/span>
purge <field> <operator> <arg> [&& <field> <oper> <arg>]…<\/span>
purge.list<\/span><\/p>\n

\u4f7f\u7528\u547d\u4ee4
vcl.load new.vcl \/usr\/local\/varnish\/etc\/varnish\/new.vcl (\u7f16\u8bd1\u51fa\u9519\u7684\u8bdd\u4f1a\u6709\u63d0\u793a\uff0c\u6210\u529f\u4f1a\u8fd4\u56de200)
200
\u7136\u540e\u4f7f\u7528
vcl.use new.vcl (\u6210\u529f\u540e\u540c\u6837\u4f1a\u8fd4\u56de200)
200
\u6b64\u65f6\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\u5df2\u7ecf\u751f\u6548\uff01<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

 \u5047\u8bbe\u542f\u52a8\u7684varnish\u670d\u52a1\u5982\u4e0b\uff1a
.\/varnishd -f ..\/etc\/varnish\/default.vcl -s malloc,1G -T 127.0.0.1:3500<\/p>\n

\u6ce8\u610f\uff1a1. varnish\u670d\u52a1\u672c\u8eab\uff0c\u542f\u52a8\u9ed8\u8ba4\u7aef\u53e380\uff1b\u5982\u679c\u9700\u8981\u91cd\u65b0\u6307\u5b9a\u542f\u52a8\u7684\u7aef\u53e3\u4f7f\u7528 -a\u9009\u9879 ,\u5982-a 0.0.0.0:8080
           2. -T \u9009\u9879\u6307\u5b9a\u4e86varnish\u670d\u52a1\u672c\u8eab\u7684\u7ba1\u7406\u7aef\u53e3\uff0c\u6b63\u662f\u5229\u7528\u8fd9\u4e2a\u7aef\u53e3\u5b8c\u6210\u4e00\u4e9b\u4e0d\u5173\u95edvarnish\u670d\u52a1\u800c\u4f7f\u65b0\u914d\u7f6e\u751f\u6548\u3002<\/b><\/p>\n

\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/b>
1\u3001\u767b\u9646\u5230\u7ba1\u7406\u63a5\u53e3\uff1a<\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1132"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1132"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1132\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}