Skip to content

Commit

Permalink
Merge pull request xmidt-org#92 from Comcast/limitsSplit
Browse files Browse the repository at this point in the history
split ulimit value from the kernel limit value
  • Loading branch information
schmidtw authored May 18, 2019
2 parents 661e761 + d75d004 commit 38b7f38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions etc/init.d/talaria
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions etc/talaria/talaria.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#KERNEL_OPEN_FILES=95000
#ULIMIT_OPEN_FILES=75000
#NET_CORE_SOMAXCONN=1000
#NET_IPV4_TCP_MAX_SYN_BACKLOG=1000
Expand Down

0 comments on commit 38b7f38

Please sign in to comment.