varnish - 为什么 Varnish 不考虑 malloc 限制?

标签 varnish

我用 运行 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



Memory

Close up

最佳答案

-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/

相关文章:

ruby-on-rails - 欺骗 Rails 应用程序使其认为它在不同的端口上

wordpress - 可能允许wp-admin使用cookie,但使用Varnish时不允许使用前端吗?

node.js - 使用 Node 设置 Varnish 缓存

caching - Varnish 在请求中混合用户代理

varnish - 从 Varnish 统计/点击中排除域

带有 SSL + Varnish 的 Magento

varnish - VCL 内置对象到子程序的映射

docker - 使用主机名而不是IP地址将 Varnish 服务器添加到Nginx

apache - 在 Ubuntu 12.04 上使用 Nginx SSL 终止的 Varnish 3.0 [无限循环问题]

ssl - 配置具有多个域的 varnish+ssl 支持