File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat monitoring" Watch "Tomcat monitoring" New topic

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?

William Brogden
Author and all-around good cowpoke

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

Imre Tokai
Ranch Hand

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

I found sg like:

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!

benjamin muktesh

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

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=" \ \ \
-Djava.rmi.server.hostname= \
-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 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 -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:
subject: Tomcat monitoring
It's not a secret anymore!