我用 运行 Varnish -s malloc,25G ,但该进程一直在增长,直到它耗尽所有服务器内存并崩溃,重新启动缓存。
知道我可以检查什么以查看有什么问题吗?
该服务器具有 16 个内核和 32 GB 的 RAM。
我正在使用 Varnish 3。
28346 ? Ss 0:16 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :9290 -T localhost:6082 -f /etc/varnish/default.vcl -s malloc,25G -p thread_pools 16 -p thread_pool_min 160 -p thread_pool_max 16000 -p thread_pool_add_delay 2
最佳答案
-s malloc,25G
only limits the cache size ,不是varnishd
的大小过程。
It is important to keep in mind that the size you specify with the -s argument is the size for the actual cache. Varnish has an overhead on top of this for keeping track of the cache, so the actual memory footprint of Varnish will exceed what the ‘-s’ argument specifies if the cache is full. The current estimate (subject to change on individual Varnish-versions) is that about 1kB of overhead needed for each object. For 1 million objects, that means 1GB extra memory usage.
如果你有一个大缓存,
file
后端可能更可取。
关于varnish - 为什么 Varnish 不考虑 malloc 限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16693677/