Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459142 - www-servers/varnish - /etc/init.d/varnishd: allow more open files through ulimit -l
Summary: www-servers/varnish - /etc/init.d/varnishd: allow more open files through uli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 12:07 UTC by werner maier
Modified: 2013-03-14 12:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description werner maier 2013-02-25 12:07:43 UTC
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.
Comment 1 Anthony Basile gentoo-dev 2013-02-26 20:45:19 UTC
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.
Comment 2 Anthony Basile gentoo-dev 2013-03-03 15:23:21 UTC
ping!

Does this fix work for you?
Comment 3 Ștefan Talpalaru 2013-03-13 12:14:01 UTC
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).
Comment 4 Anthony Basile gentoo-dev 2013-03-14 12:19:00 UTC
Okay committed without any rev bump to the ebuilds.

Thanks for testing.