Hi,
I have a server setup to host a web application using apache tomcat, with high throughput. Due to the high load I have increased the Maximum file descriptor limits, in /etc/security/limits.conf
Code:
* soft nofile 3072
* hard nofile 3072
I have a startup script in /etc/init.d/tomcat1, which starts the tomcat server, but fails to include the changes made to the limits.conf file. (Checked via jConsole - Still at default of 1024)
Code:
#! /bin/bash
#
# tomcat Start/Stop the Tomcat Http/Servlet server.
#
# chkconfig: 23456 99 65
# description: Tomcat is a java based HTTP/Servlet server
# processname: tomcat
# pidfile: /var/run/tomcat.pid
# Source function library.
. /etc/init.d/functions
. /etc/profile
RETVAL=0
TOMCAT_HOME=/usr/local/apache-tomcat/
# See how we were called.
start() {
echo -n $"Starting Tomcat "
$TOMCAT_HOME/bin/startup.sh
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/tomcat
return $RETVAL
}
stop() {
echo -n $"Stopping Tomcat "
$TOMCAT_HOME/bin/shutdown.sh
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tomcat
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
ps ax | grep $TOMCAT_HOME
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit $?
If I execute this script to start tomcat manually the limits are loaded, so why doesn't it use/load with the limits from boot?
Is there any way I can get the limits.conf to load prior to this startup script.
any information on how and when these limits are loaded would be a great help.
thanks,
Mitchell