[3.0] 49d7e92 Set ulimit -u (RLIMIT_NPROC) to unlimited for RHEL init script.
Tollef Fog Heen
tfheen at varnish-cache.org
Mon Apr 22 13:27:01 CEST 2013
commit 49d7e92b2469845f8a1d21efa0fc925b6602fdb1
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date: Mon Feb 25 11:07:39 2013 +0100
Set ulimit -u (RLIMIT_NPROC) to unlimited for RHEL init script.
diff --git a/redhat/varnish.initrc b/redhat/varnish.initrc
index 19cc274..4afa6c5 100755
--- a/redhat/varnish.initrc
+++ b/redhat/varnish.initrc
@@ -56,6 +56,10 @@ start() {
# Varnish wants to lock shared memory log in memory.
ulimit -l ${MEMLOCK:-82000}
+ # Maximum number of threads (default in CentOS is 1024, which
+ # is often too small for varnish)
+ ulimit -u ${NPROCS:-unlimited}
+
# $DAEMON_OPTS is set in /etc/sysconfig/varnish. At least, one
# has to set up a backend, or /tmp will be used, which is a bad idea.
if [ "$DAEMON_OPTS" = "" ]; then
diff --git a/redhat/varnish.sysconfig b/redhat/varnish.sysconfig
index d88712f..f5846c9 100644
--- a/redhat/varnish.sysconfig
+++ b/redhat/varnish.sysconfig
@@ -11,6 +11,9 @@ NFILES=131072
# Default log size is 82MB + header
MEMLOCK=82000
+# Maximum number of threads (for ulimit -u)
+NPROCS="unlimited"
+
# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
# DAEMON_COREFILE_LIMIT="unlimited"
More information about the varnish-commit
mailing list