Apache Tomcat always runs 3 identical processes
I have an Apache Tomcat server in production running an e-Commerce application. I am running Debian Stable using Tomcat 6 and Apache, with mod_jk.
When I start the Tomcat, I always recieve 3 identical processes in memory:
0:00 /usr/bin/jsvc -user tomcat6 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid -Djava.awt.headless=true -Xmx11000M -Xms11000M -Dsun.lang.ClassLoader.allowArraySyntax=true -verbose:gc -XX:+UseParallelGC -XX:ParallelGCThreads=6 -Dcom.sun.management.jmxremote -XX:+AgressiveHeap -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/home/tomcat-temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties org.apache.catalina.startup.Bootstrap
0:00 /usr/bin/jsvc -user tomcat6 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid -Djava.awt.headless=true -Xmx11000M -Xms11000M -Dsun.lang.ClassLoader.allowArraySyntax=true -verbose:gc -XX:+UseParallelGC -XX:ParallelGCThreads=6 -Dcom.sun.management.jmxremote -XX:+AgressiveHeap -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/home/tomcat-temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties org.apache.catalina.startup.Bootstrap
53:18 /usr/bin/jsvc -user tomcat6 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat6/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid -Djava.awt.headless=true -Xmx11000M -Xms11000M -Dsun.lang.ClassLoader.allowArraySyntax=true -verbose:gc -XX:+UseParallelGC -XX:ParallelGCThreads=6 -Dcom.sun.management.jmxremote -XX:+AgressiveHeap -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/home/tomcat-temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties org.apache.catalina.startup.Bootstrap
I am scared that this might be a problem. I just tried to kill the first two, as they do not use processor power (0:00 time), but after softly killing the first one, the other processes terminate as well.
We only have 16G in this machine, and memory is short. If I really allocate 11G to each of these 3 processes, this could be part of the troubles I had lately.
My question is this: Is this normal?开发者_Go百科 Googling for an answer, it seems that nobody else has this problem or nobody percieves this as a problem.
Oh, and the pid file names the process which uses up the CPU time.
The apparently inactive child thread is created as a result of outfile/errfile being set to SYSLOG. It receives log messages from the main child process and passes them on to syslog.
To demonstrate this, if you set don't set outfile and errfile, or set them to be regular files, only the parent and the main child thread will start. You can also see the difference in 'netstat -anp|grep jsvc', where an extra socket shows up if you're outputting to SYSLOG
So like Tim Funk says, this is nothing to worry about, and it's working as expected.
Check the process id parents - you probably will see one parent and 2 children.
Historically - MANY entries appeared in the ps table per http://wiki.apache.org/tomcat/FAQ/Linux_Unix
In new linux kernels - ps/top have whittled these down to one. But jsvc launches in a parent/child style which would explain 2 processes (but not 3).
But long story short - it is probably nothing to worry about.
精彩评论