Monitoring Webapps .. part 2
By binu on Mar 31, 2009
In my previous blog, I discussed how to monitor web applications in GlassFish. I discussed the use of asadmin CLI, but had forgotten to mention the new VisualVM GlassFish plugin that can be used for this purpose. Masoud Kalali has a a good article, Monitoring GlassFish Application Server's HTTP Service Using VisualVM, on how to use the GlassFish ViusalVM plugin. The plugin is easy to use and provides good time based charts (the response time graph for a Servlet is pretty cool).
One of my customers recently asked how they could monitor the throughput of their web container in real time. They wanted real time graphs for their production environment that displayed how many requests were processed per second in addition to the overall average response time (for all the requests including static pages, Servlets and JSPs). VisualVM can be used to get the response time data for the various Servlets individually. However, it falls short in getting the throughput information (even though it provides the number of requests processed which increases monotonically).
I have been using my own AMX client for tracking web container performance in real time (the screen shot is shown below). It is an effective monitoring tool even though the graphics and a few other items can definitely be improved. It serves my purpose, may be it will work for for you as well.
The type field is used to select either the http-listener or an application. The filter field is required to identify the component of interest (type in the listener or Servlet name). Set type = HTTPlistener and filter = http-listener-1 if you want to monitor all requests on the default listener.
In case you want to try it out, you can get the binaries here. The GlassFish related jar files are not included in the bundle to reduce the size. To use it, follow these steps.
- Download the bundle to a local directory.
- Unzip the downloaded bundle (should have the following files/dirs: MonitoringAMXClient.jar, run.sh, and lib/\*).
- Set the environment variable GLASSFISH_HOME to the root directory of the installation. The lib directory should be under the GLASSFISH_HOME location.
- Execute run.sh.
If you want to run in the graphical mode, execute run.sh without any arguments.
There is also a command line mode (it can get pretty ugly if you decide to set all the arguments :-)). To find out the usage execute run.sh --usage.If the visualvm plug-in suits your needs, I would encourage you to stick to it. However, if you think my tool would help, feel free to use it. I can provide the source code in case anyone is interested.