Permalink
Browse files

Set ulimit -u (RLIMIT_NPROC) to unlimited for RHEL init script.

  • Loading branch information...
1 parent 6a9302c commit ebb667015cc531c2cdc11c709b67c09e75467275 @daghf daghf committed Feb 25, 2013
Showing with 7 additions and 0 deletions.
  1. +4 −0 redhat/varnish.initrc
  2. +3 −0 redhat/varnish.sysconfig
View
@@ -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
View
@@ -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"

0 comments on commit ebb6670

Please sign in to comment.