mirror of https://github.com/apache/cloudstack.git
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:
parent
6d79c7c5b7
commit
eecd3fb349
|
|
@ -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" \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue