6

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?

ronnix
  • 1,514
  • 1
  • 11
  • 9
Kevin Gill
  • 61
  • 1
  • 3
  • 1
    BTW currently I am using this script (/usr/local/bin/varnishd) #! /bin/sh ulimit -n ${NFILES:-131072} ulimit -l ${MEMLOCK:-82000} exec /usr/sbin/varnishd $@ – Kevin Gill Sep 16 '11 at 10:06

1 Answers1

0

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:

DAEMON_OPTS="-a :80 \
         -T localhost:1234 \
         -f /etc/varnish/default.vcl \
         -s malloc,1G"
jaybrau
  • 403
  • 1
  • 3
  • 9