[master] bca2da5 Adjust ulimit on RPM platforms

Tollef Fog Heen tfheen at varnish-cache.org
Wed Jul 31 13:02:54 CEST 2013


commit bca2da56c94c0b472b667f0d1bcf2444d4ae6ff8
Author: Ingvar Hagelund <ingvar at redpill-linpro.com>
Date:   Wed Jul 31 13:02:18 2013 +0200

    Adjust ulimit on RPM platforms
    
    The default number of processes/threads (ulimit -u) on rhel6 and clones
    is 1024, which is too little for varnish.
    
    This patch adds a variable NPROC to sysconfig/initscript suppport in the
    rpm package. If no value is set in sysconfig, it will be set to 10000.

diff --git a/redhat/varnish.initrc b/redhat/varnish.initrc
index c2faa25..323024b 100755
--- a/redhat/varnish.initrc
+++ b/redhat/varnish.initrc
@@ -53,6 +53,9 @@ start() {
 	# Open files (usually 1024, which is way too small for varnish)
 	ulimit -n ${NFILES:-131072}
 
+	# Open processes/threads (usually 1024 on rhel6, which is too little for varnish)
+	ulimit -u ${NPROC:-10000}
+
 	# Varnish wants to lock shared memory log in memory. 
 	ulimit -l ${MEMLOCK:-82000}
 
diff --git a/redhat/varnish.sysconfig b/redhat/varnish.sysconfig
index f5846c9..b1b640c 100644
--- a/redhat/varnish.sysconfig
+++ b/redhat/varnish.sysconfig
@@ -7,6 +7,9 @@
 # Maximum number of open files (for ulimit -n)
 NFILES=131072
 
+# Maximum number of processes/threads (for ulimit -u)
+NPROC=10000
+
 # Locked shared memory (for ulimit -l)
 # Default log size is 82MB + header
 MEMLOCK=82000



More information about the varnish-commit mailing list