APPLE-313: Ulimit fixes for cloudstack-{agent, management}

Increases/sets ulimit for cloudstack agent and management. This would fix
any issues with opening more files than permissible limit (usually 1024-4096).

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-10-25 13:34:01 +05:30 committed by Abhinandan Prateek
parent 6d79c7c5b7
commit eecd3fb349
3 changed files with 15 additions and 4 deletions

View File

@ -65,7 +65,18 @@ PCP=`ls /usr/share/cloudstack-agent/plugins/*.jar 2>/dev/null | tr '\n' ':' | se
# AgentShell implements the JSVC daemon methods
export CLASSPATH="/usr/share/java/commons-daemon.jar:$ACP:$PCP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "65536" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 65536
fi
fi
}
start() {
set_ulimit
echo -n $"Starting $PROGNAME: "
if hostname --fqdn >/dev/null 2>&1 ; then
$JSVC -Djava.io.tmpdir="$TMP" -Xms256m -Xmx2048m -cp "$CLASSPATH" -pidfile "$PIDFILE" \

View File

@ -71,10 +71,10 @@ stop() {
set_ulimit() {
fd_limit=`ulimit -n`
if [ "$fd_limit" != "4096" ]; then
if [ "$fd_limit" != "65536" ]; then
user=`whoami`
if [ $user == "root" ]; then
ulimit -n 4096
ulimit -n 65536
fi
fi
}

View File

@ -17,5 +17,5 @@
# Specific limits for the CloudStack management server which
# runs under the user 'cloud' by default
@MSUSER@ hard nofile 4096
@MSUSER@ soft nofile 4096
@MSUSER@ hard nofile 65536
@MSUSER@ soft nofile 65536