【发布时间】:2013-07-01 19:50:41
【问题描述】:
我们的 Varnish 实例
/usr/sbin/varnishd -P /var/run/varnish.pid -a :6081 -f /etc/varnish/cm-varnish.vcl -T 127.0.0.1:6082 -t 1h -u varnish -g varnish -S /etc/varnish/secret -s malloc,24G -p shm_reclen 10000 -p http_req_hdr_len 10000 -p thread_pool_add_delay 2 -p thread_pools 8 -p thread_pool_min 500 -p thread_pool_max 4000 -p sess_workspace 1073741824
32G 内存,16 核处理器,我们为清漆分配 24GB 内存
我们的 varnish 实例的平均正常运行时间仍然是 3 小时,这非常低。我们的缓存 TTL 是 1 小时,宽限期是 2 小时。我们通常每 5 分钟通过一个 java 进程刷新一次缓存内容[点击次数超过 n 次]。我们通过不断地轮询varnishncsa 输出来跟踪清漆的命中。
我试过varnishadm panic.show
Last panic at: Thu, 23 May 2013 09:14:42 GMT
Assert error in WSLR(), cache_shmlog.c line 220:
Condition(VSL_END(w->wlp, l) < w->wle) not true.
thread = (cache-worker)
ident = Linux,2.6.18-238.el5,x86_64,-smalloc,-smalloc,-hcritbit,epoll
Backtrace:
0x42dc76: /usr/sbin/varnishd [0x42dc76]
0x432d1f: /usr/sbin/varnishd(WSLR+0x27f) [0x432d1f]
0x42a667: /usr/sbin/varnishd [0x42a667]
0x42a89e: /usr/sbin/varnishd(http_DissectRequest+0xee) [0x42a89e]
0x4187d1: /usr/sbin/varnishd(CNT_Session+0x741) [0x4187d1]
0x42f706: /usr/sbin/varnishd [0x42f706]
0x3009c0673d: /lib64/libpthread.so.0 [0x3009c0673d]
0x30094d40cd: /lib64/libc.so.6(clone+0x6d) [0x30094d40cd]
关于我们遗漏了什么的任何意见?
【问题讨论】:
-
您是否尝试过使用默认高级值运行 varnish?我的意思是没有
-p shm_reclen 10000 -p http_req_hdr_len 10000 -p thread_pool_add_delay 2 -p thread_pools 8 -p thread_pool_min 500 -p thread_pool_max 4000 -p sess_workspace 1073741824 -
我们根据kly.no/posts/2010_01_26__Varnish_best_practices__.html选择了这个值,这和断言有什么关系
-
那篇文章已经很老了(指的是 Varnish 2.x AFAIK),并且明确指出“根据需要进行调整”。对我来说,调试/跟踪此类问题的第一件事就是坚持默认配置。
标签: restart varnish varnish-vcl