53.2. varnish utility

本文介绍如何使用Varnish进行缓存管理,包括状态监控、缓存清除、请求头部处理等操作。提供了详细的命令示例,如使用varnishstat查看状态、varnishadm进行缓存管理等。

53.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

			

53.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
			
			
53.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*$
				

53.2.3. varnishtop

varnishtop -i rxurl

varnishtop -i txurl

varnishtop -i RxHeader -I Accept-Encoding
			

53.2.4. varnishhist

53.2.5. varnishsizes




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

有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.InvalidOperationException: DragDrop 注册失败。 ---> System.Threading.ThreadStateException: 在可以调用 OLE 之前,必须将当前线程设置为单线程单元(STA)模式。请确保您的 Main 函数带有 STAThreadAttribute 标记。 在 System.Windows.Forms.Control.SetAcceptDrops(Boolean accept) --- 内部异常堆栈跟踪的结尾 --- 在 System.Windows.Forms.Control.SetAcceptDrops(Boolean accept) 在 System.Windows.Forms.Control.OnHandleCreated(EventArgs e) 在 System.Windows.Forms.TreeView.OnHandleCreated(EventArgs e) 在 System.Windows.Forms.Control.WmCreate(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.TreeView.WndProc(Message& m) 在 Cognex.VisionPro.Implementation.Internal.CogTreeViewBase.CogPaintedTreeView.DefaultWndProc(Message& m) 在 Cognex.VisionPro.Implementation.Internal.CogTreeViewBase.TreeView_WndProcRunning(Object sender, Message& msg, Boolean& cancel) 在 Cognex.VisionPro.Implementation.Internal.CogTreeViewBase.CogPaintedTreeView.OnWndProcRunning(Message& msg, Boolean& cancel) 在 Cognex.VisionPro.Implementation.Internal.CogTreeViewBase.CogPaintedTreeView.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本:4.0.0.0 Win32 版本:4.8.9195.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll ---------------------------------------- Vision-撕胶带 程序集版本:1.0.0.0 Win32 版本:1.0.0.0 基本代码:file:///D:/soft/Debug/Vision-%E6%92%95%E8%83%B6%E5%B8%A6.exe ---------------------------------------- System.Windows.Forms 程序集版本:4.0.0.0 Win32 版本:4.8.9195.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System 程序集版本:4.0.0.0 Win32 版本:4.8.9195.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Core 程序集版本:4.0.0.0 Win32 版本:4.8.9195.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Xml 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Cognex.VisionPro.Controls 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.Controls/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Controls.dll ---------------------------------------- Cognex.VisionPro.Display.Controls 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.Display.Controls/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Display.Controls.dll ---------------------------------------- Cognex.VisionPro.Core 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.Core/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Core.dll ---------------------------------------- mscorlib.resources 程序集版本:4.0.0.0 Win32 版本:4.8.4084.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本:4.0.0.0 Win32 版本:4.8.4084.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- Cognex.VisionPro 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.dll ---------------------------------------- Cognex.VisionPro.Interop.Core 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.Interop.Core/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Interop.Core.dll ---------------------------------------- Cognex.VisionPro.Display.Controls.resources 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.Display.Controls.resources/v4.0_53.2.0.0_zh-Hans_ef0f902af9dee505/Cognex.VisionPro.Display.Controls.resources.dll ---------------------------------------- Cognex.VisionPro.Interop.DisplayCtl 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.Interop.DisplayCtl/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Interop.DisplayCtl.dll ---------------------------------------- Serilog 程序集版本:2.0.0.0 Win32 版本:2.12.0.0 基本代码:file:///D:/soft/Debug/Serilog.DLL ---------------------------------------- Serilog.Sinks.Console 程序集版本:4.0.1.0 Win32 版本:4.0.1.0 基本代码:file:///D:/soft/Debug/Serilog.Sinks.Console.DLL ---------------------------------------- Serilog.Sinks.File 程序集版本:5.0.0.0 Win32 版本:5.0.0.0 基本代码:file:///D:/soft/Debug/Serilog.Sinks.File.DLL ---------------------------------------- MvCamCtrl.Net 程序集版本:0.0.0.0 Win32 版本:0.0.0.0 基本代码:file:///D:/soft/Debug/MvCamCtrl.Net.DLL ---------------------------------------- Cognex.VisionPro.ToolGroup 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.ToolGroup/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.ToolGroup.dll ---------------------------------------- System.Runtime.Serialization.Formatters.Soap 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization.Formatters.Soap/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Serialization.Formatters.Soap.dll ---------------------------------------- Cognex.VisionPro.PMAlign 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.PMAlign/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.PMAlign.dll ---------------------------------------- Cognex.VisionPro.CalibFix 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.CalibFix/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.CalibFix.dll ---------------------------------------- Cognex.VisionPro.Blob 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.Blob/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.Blob.dll ---------------------------------------- Cognex.VisionPro.QuickBuild.Core 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.QuickBuild.Core/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.QuickBuild.Core.dll ---------------------------------------- cowsi2ha 程序集版本:0.0.0.0 Win32 版本:4.8.9195.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.resources 程序集版本:4.0.0.0 Win32 版本:4.8.4084.0 built by: NET48REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.resources.dll ---------------------------------------- Accessibility 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- Cognex.VisionPro.resources 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.resources/v4.0_53.2.0.0_zh-Hans_ef0f902af9dee505/Cognex.VisionPro.resources.dll ---------------------------------------- Cognex.VisionPro.CorePlus 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.CorePlus/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.CorePlus.dll ---------------------------------------- Cognex.VisionPro.ImageFile 程序集版本:53.2.0.0 Win32 版本: 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.ImageFile/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.ImageFile.dll ---------------------------------------- Cognex.VisionPro.ToolGroup.Controls 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/Cognex.VisionPro.ToolGroup.Controls/v4.0_53.2.0.0__ef0f902af9dee505/Cognex.VisionPro.ToolGroup.Controls.dll ---------------------------------------- Cognex.VisionPro.Controls.resources 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.Controls.resources/v4.0_53.2.0.0_zh-Hans_ef0f902af9dee505/Cognex.VisionPro.Controls.resources.dll ---------------------------------------- Cognex.VisionPro.ToolGroup.Controls.resources 程序集版本:53.2.0.0 Win32 版本:53.2.0.0 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Cognex.VisionPro.ToolGroup.Controls.resources/v4.0_53.2.0.0_zh-Hans_ef0f902af9dee505/Cognex.VisionPro.ToolGroup.Controls.resources.dll ---------------------------------------- Microsoft.GeneratedCode 程序集版本:1.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何未经处理的异常 都将被发送到在此计算机上注册的 JIT 调试程序, 而不是由此对话框处理。
最新发布
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值