diff --git a/etc/caduceus/caduceus.env.example b/etc/caduceus/caduceus.env.example index 4ae21a83..baaeed0b 100644 --- a/etc/caduceus/caduceus.env.example +++ b/etc/caduceus/caduceus.env.example @@ -1,3 +1,4 @@ +#KERNEL_OPEN_FILES=95000 #ULIMIT_OPEN_FILES=75000 #NET_CORE_SOMAXCONN=1000 #NET_IPV4_TCP_MAX_SYN_BACKLOG=1000 diff --git a/etc/init.d/caduceus b/etc/init.d/caduceus index a65e329e..13c50964 100644 --- a/etc/init.d/caduceus +++ b/etc/init.d/caduceus @@ -19,15 +19,16 @@ RETVAL=0 # Set limits here in addition to limits.conf #------------------------------------------------------------------------------- -if [ -n "$ULIMIT_OPEN_FILES" ]; then - sysctl -w fs.file-max=$ULIMIT_OPEN_FILES > /dev/null +if [ -n "$KERNEL_OPEN_FILES" ]; then + sysctl -w fs.file-max=$KERNEL_OPEN_FILES > /dev/null RETVAL=$? - [ $RETVAL -ne 0 ] && echo "fs.file-max=$ULIMIT_OPEN_FILES failed" && exit $RETVAL + [ $RETVAL -ne 0 ] && echo "fs.file-max=$KERNEL_OPEN_FILES failed" && exit $RETVAL - sysctl -w fs.nr_open=$ULIMIT_OPEN_FILES > /dev/null + sysctl -w fs.nr_open=$KERNEL_OPEN_FILES > /dev/null RETVAL=$? - [ $RETVAL -ne 0 ] && echo "fs.nr_open=$ULIMIT_OPEN_FILES failed" && exit $RETVAL - + [ $RETVAL -ne 0 ] && echo "fs.nr_open=$KERNEL_OPEN_FILES failed" && exit $RETVAL +fi +if [ -n "$ULIMIT_OPEN_FILES" ]; then ulimit -n $ULIMIT_OPEN_FILES > /dev/null RETVAL=$? [ $RETVAL -ne 0 ] && echo "ulimit -n $ULIMIT_OPEN_FILES failed" && exit $RETVAL