Default ulimit -n (1024) is too low for production use. Server starts marking backends as dead at about 40-50 Mbit traffic. increasing the max-open-files works fine. --- /usr/portage/www-servers/varnish/files/varnishd.initd 2009-08-30 08:28:07.000000000 +0200 +++ /etc/init.d/varnishd 2013-02-08 14:45:52.000000000 +0100 @@ -11,6 +11,8 @@ ebegin "Starting varnish" #allow varnishd to lock logfile to memory ulimit -l 82000 + # some more open files than 1024 + ulimit -n 32786 start-stop-daemon --quiet --start --pidfile /var/run/varnishd.pid --exec /usr/sbin/varnishd -- -P /var/run/varnishd.pid ${VARNISHD_OPTS} &> /dev/null eend $? please update the init script.
This is best done via the conf.d/varnishd file. Try adding the following line: rc_ulimit="-n 32786" If it works for you, I'll commit it. In fact, try removing the ulimit -l 82000 from the init.d and adding rc_ulimit="-n 32786 -l 82000" That's the cleanest solution. Let me know.
ping! Does this fix work for you?
I can confirm that setting rc_ulimit="-n 32786 -l 82000" in /etc/conf.d/varnishd works (tested by executing "ulimit -n -l" in the init script's start function).
Okay committed without any rev bump to the ebuilds. Thanks for testing.