Using JConsole with Web Server 7.0
One of the many interesting features of Sun Java System Web Server 7.0 is Extensive Real-Time Monitoring Support allowing customers to monitor the performance of Web Server both while serving static files as well as while serving JSP / Servlet based web applications. If you haven't already, do checkout our Technology Preview release and What'z new with Web Server 7.0 . Also, our Monitoring Your Server link can provide you with information on how to monitor our Web Server as well.
Coming back to the topic of my today's blog, if in case, you are interested in monitoring JVM performance then JConsole shipped with J2SE 5.0 Monitoring Tools would be of great interest to you. Kindly checkout article - Using JConsole to Monitor Applications to provide you with introduction on how to leverage this tool.
How this whole thing works is pretty simple - J2SE 5.0 has built-in instrumentation that enables you to monitor and manage the JVM using JMX. So, all you have to do is to enable the JMX Agent within the java application and JConsole tool will be able to connect this application and monitor / measure its JVM. This article will provide you with more insight on how to enable JMX agent within a java application. I would say this article is the foundation for my today's blog.
Now, here is a brief mention as to how to configure remote JMX Agent within Web Server 7.0. Use Web Server 7.0's GUI or CLI to add the following JVM options to the web server's configuration. Also, you might find the Adding a JVM Option link useful to add these jvm options. At the end of successfully adding these options to server's jvm options, you will have to restart the server instance.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6969 (or choose any other port is not used by any one in your machine)
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
You can now fire up jconsole (found under JAVA_HOME/bin directory) program. Now select the 'Remote' option and provide the hostname and port number where
hostname is the hostname in which the web server 7.0 containing the above JVM options are running
port is the port number that was provided to the jmxremote.port JVM option (number in the second line)
For the purpose of this blog, I have kept things simple by disabling authentication as well as SSL. In your case, you might want to at least enable authentication if not SSL to avoid unwanted eyes poking through your Web Server's performance data.
Just a note - In production environment or while the server is under load you might want to consider running jconsole on a remote machine and connecting to the Web Server remotely, This is because jconsole itself is noted to take lot of resources during startup and providing monitoring data.


Coming back to the topic of my today's blog, if in case, you are interested in monitoring JVM performance then JConsole shipped with J2SE 5.0 Monitoring Tools would be of great interest to you. Kindly checkout article - Using JConsole to Monitor Applications to provide you with introduction on how to leverage this tool.
How this whole thing works is pretty simple - J2SE 5.0 has built-in instrumentation that enables you to monitor and manage the JVM using JMX. So, all you have to do is to enable the JMX Agent within the java application and JConsole tool will be able to connect this application and monitor / measure its JVM. This article will provide you with more insight on how to enable JMX agent within a java application. I would say this article is the foundation for my today's blog.
Now, here is a brief mention as to how to configure remote JMX Agent within Web Server 7.0. Use Web Server 7.0's GUI or CLI to add the following JVM options to the web server's configuration. Also, you might find the Adding a JVM Option link useful to add these jvm options. At the end of successfully adding these options to server's jvm options, you will have to restart the server instance.
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6969 (or choose any other port is not used by any one in your machine)
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
You can now fire up jconsole (found under JAVA_HOME/bin directory) program. Now select the 'Remote' option and provide the hostname and port number where
hostname is the hostname in which the web server 7.0 containing the above JVM options are running
port is the port number that was provided to the jmxremote.port JVM option (number in the second line)
For the purpose of this blog, I have kept things simple by disabling authentication as well as SSL. In your case, you might want to at least enable authentication if not SSL to avoid unwanted eyes poking through your Web Server's performance data.
Just a note - In production environment or while the server is under load you might want to consider running jconsole on a remote machine and connecting to the Web Server remotely, This is because jconsole itself is noted to take lot of resources during startup and providing monitoring data.




Posted by Thorleif Wiik on October 01, 2006 at 02:35 AM PDT #
I would like to use the verbose method of the VM that can be set from the MBeans tab under java.lang, Memory of the jconsole. However, I do not understand where to find the output after setting verbose to true. I would like to save the info to a log file, would you know how I can get my JVM to save it to a log in Windows ? I am using Sun One Web Server v6.1.
Posted by Dolores Rowe on July 01, 2009 at 08:08 AM PDT #
you might want to post your question to - http://forums.sun.com/forum.jspa?forumID=538
Posted by Sriram Natarajan on July 01, 2009 at 05:05 PM PDT #