8.2. varnish utility

简介:

8.2.1. status

$ varnishstat
or
$ varnishstat -n /var/lib/varnish/atom-netkiller/
			

HTTP Head

$ curl -I http://bg7nyt.mooo.com/
HTTP/1.1 404 Not Found
X-Powered-By: PHP/5.2.6-3ubuntu4.2
Content-type: text/html
Server: lighttpd/1.4.19
Content-Length: 539
Date: Wed, 23 Sep 2009 00:05:11 GMT
X-Varnish: 938430316
Age: 0
Via: 1.1 varnish
Connection: keep-alive
			

test gzip,defalte

$ curl -H Accept-Encoding:gzip,defalte -I http://bg7nyt.mooo.com/
HTTP/1.1 200 OK
X-Powered-By: PHP/5.2.6-3ubuntu4.2
Content-Encoding: gzip
Vary: Accept-Encoding
Content-type: text/html
Server: lighttpd/1.4.19
Date: Wed, 23 Sep 2009 00:08:51 GMT
X-Varnish: 938430335
Age: 0
Via: 1.1 varnish
Connection: keep-alive

			

8.2.2. varnishadm

help messages

			
$ varnishadm -T 127.0.0.1:6082 help
help [command]
ping [timestamp]
status
start
stop
stats
vcl.load <configname> <filename>
vcl.inline <configname> <quoted_VCLstring>
vcl.use <configname>
vcl.discard <configname>
vcl.list
vcl.show <configname>
param.show [-l] [<param>]
param.set <param> <value>
quit
purge.url <regexp>
purge.hash <regexp>
purge <field> <operator> <arg> [&& <field> <oper> <arg>]...
purge.list
			
			

8.2.2.1. 清除缓存

通过Varnish管理端口,使用正则表达式批量清除缓存:

清除所有缓存

/usr/local/varnish/bin/varnishadm -T 127.0.0.1:6082 url.purge *$
				

http://bg7nyt.mooo.com/zh-cn/technology/news.html 清除类/zh-cn/下所有缓存

/usr/local/varnish/bin/varnishadm -T 127.0.0.1:6082 url.purge /zh-cn/
				

/usr/local/varnish/bin/varnishadm -T 127.0.0.1:3500 url.purge w*$
				

8.2.3. varnishtop

varnishtop -i rxurl

varnishtop -i txurl

varnishtop -i RxHeader -I Accept-Encoding
			

8.2.4. varnishhist

8.2.5. varnishsizes





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
NoSQL 应用服务中间件 PHP
WordPress Caching Solutions Part 2 - Configuring NGINX FastCGI Static Page Caching and Final Load Testing
In Part 1 of this series about Caching solutions for WordPress on the Alibaba Cloud we set up server monitor and ran some load testing .
2365 0
|
网络协议 网络安全 Memcache
Introducing mcrouter: A memcached protocol router for scaling memcached deployments
Mcrouter 是一个基于Memcached 协议的路由器,它是 Facebook缓存架构的核心组件,在峰值的时候,它能够处理每秒50亿次的请求。近日,Facebook开放了Mcrouter的源代码,且遵从BSD协议,希望能够帮助更多的网站使用Mcrouter并扩大其系统规模。
2485 0