Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat monitoring

 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic