我在Ubuntu 9.10的testing环境(虚拟机)上运行Varnish(来自Ubuntu不稳定的apt版本库的2.0.4,尽pipe我也使用了标准版本库),很快就会变成10.04。
当我有一个工作configuration和服务器启动成功似乎一切都很好,但是,如果出于某种原因,我停止,然后重新启动清漆守护进程它并不总是正常启动,没有错误进入系统日志或消息来指示可能是错误的。
如果我在debugging模式下运行清漆( -d ),并在出现提示时执行启动,那么将会运行7次,但是偶尔它会“静静地”closures。
我的启动命令是($ 1允许我传递-d到这个生活的脚本):
varnishd -a :80 $1 \ -T 127.0.0.1:6082 \ -s malloc,1GB \ -f /home/deploy/mysite.vcl \ -u deploy \ -g deploy \ -p obj_workspace=4096 \ -p sess_workspace=262144 \ -p listen_depth=2048 \ -p overflow_max=2000 \ -p ping_interval=2 \ -p log_hashstring=off \ -h classic,5000009 \ -p thread_pool_max=1000 \ -p lru_interval=60 \ -p esi_syntax=0x00000003 \ -p sess_timeout=10 \ -p thread_pools=1 \ -p thread_pool_min=100 \ -p shm_workspace=32768 \ -p thread_pool_add_delay=1
而VCL看起来像这样:
# nginx/passenger server, HTTP:81 backend default { .host = "127.0.0.1"; .port = "81"; } sub vcl_recv { # Don't cache the /useradmin or /admin path if (req.url ~ "^/(useradmin|admin|session|sessions|login|members|logout|forgot_password)") { pipe; } # If cache is 'regenerating' then allow for old cache to be served set req.grace = 2m; # Forward to cache lookup lookup; } # This should be obvious sub vcl_hit { deliver; } sub vcl_fetch { # See link #16, allow for old cache serving set obj.grace = 2m; if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") { deliver; } remove obj.http.Set-Cookie; remove obj.http.Etag; set obj.http.Cache-Control = "no-cache"; set obj.ttl = 7d; deliver; }
任何build议将不胜感激,这是让我绝对疯狂,尤其是因为它的这种不一致的行为。
当debugging模式和错误文件不起作用时,strace是我们最好的朋友。
在varnish start命令之前inputstrace -f -o strace.out ,以便strace可以跟踪所有的系统调用。
然后,看看strace.out,特别是最后一行。 在这种特殊情况下,strace总是一个很好的启发方式。
希望这可以帮助。
升级到2.1.2
http://sourceforge.net/projects/varnish/files/
你可以使用alien来安装RPM版本(作为一个testing),然后把Debian软件包从2.0改成2.1.2 .deb