tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Simple Tomcat monitoring ?
Date Tue, 12 Apr 2011 13:00:20 GMT
On Tue, Apr 12, 2011 at 14:26, André Warnier <aw@ice-sa.com> wrote:
> Francis GALIEGUE wrote:
>>
>> On Tue, Apr 12, 2011 at 12:20, André Warnier <aw@ice-sa.com> wrote:
>> [...]
>>>
>>> Considering all the above, which would be the easiest/quickest way of
>>> starting to figure out what this tomcat is doing, and where the
>>> system/application bottleneck might be ?
>>>
>>
>> We have the following tools, all very easy to setup and run:
>>
>> * SNMP monitoring of the JVM (allows to see the amount of memory
>> consumed, the number of threads, and others - the MIB is well
>> defined);
>> * a shell script sending the results of a kill -3 on the JVM (a thread
>> dump);
>> * a script which triggers when a java.lang.OutOfMemoryError is thrown.
>>
>> If you are interested in any of it, I can tell you how we do it.
>>
>> And, considering that your server has 12 GB RAM, you could indeed do
>> with a little more heap space!
>>
>
> Thanks. I think I'll accept your offer of details.
>
> I don't think that OOM is a problem, but the first 2 would be a good start.
>
> About SNMP monitoring : I already have a "munin agent" installed on that
> system, and a munin server collecting stuff like overall cpu and memory
> usage.
> To your knowledge, does there exist a way to collect this JVM SNMP
> information via a munin plugin ?
>

I don't use Munin, I use cacti, but if Munin can collect SNMP
information then it's only a matter of having Munin fetch the
appropriate OIDs. More details in a separate mail.

>
> About the script doing a kill -3 : where does the thread dump go, when you
> do that ? and how does the script know which PID is Tomcat ?
>

Mine does since the environment fetches the PID file and sends the
signal to that process. It sends output to either stdout or stderr, I
don't know. Script attached. Read the comments carefully, it is
somewhat a hack (could be improved by detecting, say, if the output
went to stderr).

> On that system, the tomcat processes look like this :
>
> # ps -ef | grep java
> root     20997     1  0 12:18 ?        00:00:00 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> root     20998 20997  0 12:18 ?        00:00:00 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> tomcat55 20999 20997  0 12:18 ?        00:00:04 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> vogon2:~#
>
> So there are 3 Tomcat-related processes, all running under jsvc.  I am not
> quite sure which one does what.
>

Wild guess: it's the one in the PID file that matters (-pidfile
/xxxxxxx). It should be a variable in the Tomcat base configuration
file.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris


Mime
View raw message