如何使用supervisord配置ulimit(启动varnish)
我正在将服务器配置迁移到supervisord(从init.d 文件)。
有一些 varish 运行的实例。我记得当我开始使用 varnish 时,我遇到了 ulimit 问题,因此 init.d/varnish 脚本中有以下几行
ulimit -n ${NFILES:-131072} ulimit -l ${MEMLOCK:-82000}
我正在配置supervisord 以使用参数运行 /usr/sbin/varnishd 程序。
如何通过supervisord配置ulimit设置?我是否只需将 varnishd 程序包装在脚本中?
I am migrating a server configuration to supervisord (from init.d files).
There are a few instances of varish running. I remember when I started using varnish I had ulimit problems so there is the following lines in the init.d/varnish scripts
ulimit -n ${NFILES:-131072}
ulimit -l ${MEMLOCK:-82000}
I am configuring supervisord to run the /usr/sbin/varnishd program with arguments.
How do you configure the ulimit settings via supervisord? Do I just wrap the varnishd program in a script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您确实需要走这条路,最好在系统级别设置 ulimit (请参阅 limits.conf)。但是 varnish 在 malloc 后端而不是文件后端上表现最好,因此如果您有内存资源,这将解决您的 ulimit 问题并提高您的性能。 文档在这里,但基本上你有类似的东西/etc/default/varnish 中的“-s malloc,1G”:
If you really need to go this route it would be preferred to set the ulimit at a system level (see limits.conf). But varnish performs best with a malloc backend rather than a file backend, so if you have the memory resources, this would solve your ulimit problem and improve your performance. The documentation is here, but basically you have something like "-s malloc,1G" in your /etc/default/varnish: