aspose file tools*
The moose likes Tomcat and the fly likes Tomcat monitoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat monitoring" Watch "Tomcat monitoring" New topic
Author

Tomcat monitoring

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
I want to monitor performance of Tomcat server when I'm running an application.

Memory usage, threads, objects, user sessions, sql queries and as much as possible of other
information on server.

Where can i find tools for this?


Regards
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
For some of these, the Tomcat Manager application works just fine. You should find a manager-howto.html document in a typical Tomcat installation.

Bill
Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130
How can i monitor Tomcat with JConsole?


I found sg like:
$ CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=test-idc.internet2.edu";
$ export CATALINA_OPTS;

and i put that in catalina.but, but so far i have no success with the configuration.

If sy has experience with this set up, please write down the step by step process. Thanks!


Regards
benjamin muktesh
Greenhorn

Joined: Jul 01, 2008
Posts: 24
In the tomcat bin directory open Catalina.sh

And add an entry for
JAVA_OPTS Java runtime options used when the "start", "stop", or "run" command is executed.

Set the param to (modify as per your requirement)
export CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=9002 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname=10.2.106.100 \
-Xms12m -Xmx64m -XX:MaxPermSize=32m"

Here 9002 is the jmx port
Hostname is the ip of the tomcat server

The last line is where you set the jvm heap size
-Xms = initial
-Xmx = Maximum

Now go to you jdk/bin directory and open up a jconsole

Select the remote tab and provide the settings
Ip and port number , which in our case are 10.2.106.100 and 9002 respectively.

You are all set.
[ August 15, 2008: Message edited by: benjamin muktesh ]
Ajay Vikas
Ranch Hand

Joined: Nov 08, 2006
Posts: 66
Its great Benjamin for your detail explanation.

Can you please help me in configuring the same in localhost windows tomcat installation.
I have edited catalina.bat with,
set CATALINA_OPTS=-Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Xms12m -Xmx64m -XX:MaxPermSize=32m

and then started tomcat and opened jconsole , but when i tried to submit values as localhost and 9002 in remote tab it says as "Connection failed".

I believe there may be error at Djava.rmi.server.hostname because i do not have any rmi server configured.

Please guide me over this...

Thank you!!!

- Vikas.
SCJP 1.4.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat monitoring