How to configure ulimit with supervisord (launch varnish)

I am transferring the server configuration to superisord (from init.d files).

There are several examples of running varish. I remember when I started using varnish, I had problems with ulimit, so the init.d / lnit scripts have the following lines

ulimit -n $ {NFILES: -131072} ulimit -l $ {MEMLOCK: -82000}

I am configuring supervisord to run the program / usr / sbin / varnishd with arguments.

How to configure ulimit parameters using supervisor? Am I just wrapping a varnishd program in a script?

+6
source share
1 answer

If you really need to go this route, it would be advisable to install ulimit at the system level (see limits.conf ). But the varnish works best with the malloc backend and not with the file server, so if you have memory resources, this will 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 / ln:

DAEMON_OPTS="-a :80 \ -T localhost:1234 \ -f /etc/varnish/default.vcl \ -s malloc,1G" 
0
source

Source: https://habr.com/ru/post/897456/


All Articles