by March 1, 2008 0 comments



Though Tomcat comes with functionality through which its administrator can
monitor and manage various deployed Web applications as well as access the JMX
beans and performance logs, the information gained through these logs and beans
is hard to read and interpret. If a Tomcat administrator wishes to have the JVM
(Java Virtual Machine) or the datasource usage information, he will get the
information but in a very crude format. Now imagine if he gets the same
information about JVM memory usage in a graphical format rather than just crude
numbers, he would be able to interpret the information easily and it would help
him take steps to avoid any memory leak.

Lambda Probe is one such Open Source tool that helps in effective monitoring
and administering of the Tomcat Web application server. In this article we will
explore various features of Lambda Probe through which various Tomcat runtime
parameters can be monitored easily which otherwise are ignored because of the
complexity to access and interpret them.

Direct Hit!

Applies To:
Web Masters
USP:Tool to monitor &administer Tomcat
Web-Server
Primary Link:
www.lamdaprobe.org
Google Keywords:
Lambda Probe

Installation
The Lambda Probe is a Java Web application archive (WAR) and is available
for download as a zipped file from the site- lambdaprobe.org. Once Lambda Probe
has been downloaded, you can install the extracted probe.war file onto the
Tomcat Web application server either through the Tomcat’s manager application or
by placing the file in Tomcat’s Web apps directory for deployment. The Lambda
Probe application will get deployed on the Tomcat server. To access the Web
application navigate to the URL-http://localhost:<PORT>/probe, where <PORT> is
the port number on which the Tomcat server is configured to run (in our case,
80). Before using the Probe Web application, we will have to create new security
roles for Lambda Probe.

Tomcat’s roles are configured through tomcat-user.xml file. The roles to be
declared are manager, poweruser, poweruserplus, and probeuser. The role of
‘manager’ is same as required by Tomcat Manager and provides full access to
Lambda Probe functionality. While the roles of poweruser and poweruserplus are
having few privileges restricted, and the role of probeuser is least privileged
having just access to read-only functionalities. While making changes to tomcat-user.xml
file make sure that the user tomcat is assigned the role of manager. The
following code snippet defines all four roles for the Lambda probe to work on
Tomcat server.

The deployed applications on Tomcat are listed;
clicking on an application name will display its detailed status and options
to view other attributes

<role rolename="manager"/> <role rolename="tomcat"/>
<role rolename="poweruser"/> <role rolename="role1"/> <role rolename="poweruserplus"/>
<role rolename="probeuser"/> <user username="both" password="tomcat"
roles="tomcat,role1"/> <user username="tomcat" password="tomcat" roles="tomcat,manager,
poweruser,poweruserplus,probeuser"/> <user username="role1" password="tomcat"
roles="role1"/>

Now after doing the necessary changes restart the server and access the
Lambda Probe application after supplying the username and password.

Features
When you navigate to the URL of the Probe application, it presents a list of
all the deployed applications on the server and their status with information
like number of sessions, total number of servlets requests, etc. Through the
navigation tab, the user can access other features like datasource monitoring,
deployment of Web apps, system information, etc. Among these features datasource
monitoring, JVM memory inspection, and session inspection would be helpful to an
administrator in charge of monitoring and maintaining the Tomcat server. For
every Tomcat administrator the datasource pool utilization and its optimal
performance is a major concern. In a production scenario a deployed application
can crash if its allocated database connection pool gets exhausted. Lambda Probe
comes handy here for Tomcat admins with its intuitive datasource monitoring
feature, which represents each application’s utilization of pooled database
connection in a graphical format. Another feature is of ‘Group by JDBC URL,’
which helps in seeing how many total connections are being utilized actually by
any given deployed application.

Memory Utilization shows the JVM’s various
processes on a real-time basis and in a graphical format

This particular information can help administrator to predict how many client
connections are allowed by the database. The Memory Utilization feature can be
found under System Information tab. This system information tab displays the
summarized information of memory, OS, and container information along with
option to force garbage collection if the memory utilization has increased to
higher side. Sometimes end users are shown blank screens or ‘Page Not Found’
errors, which occur because of OutOfMemory exception errors. The JVM has an
elaborate memory management that manages the working memory allocated to Java
processes. Lambda Probe gives the administrator this JVM management like
facility through Memory Utilization option. This helps the administrator to
process and predict situations where the memory leaks may occur and hence
prevent an application crash. This functionality represents the real-time JVM
memory space data (PermGen, CodeCache, etc) in a graphical format. As this
information is accessed through JMX (Java Management Extensions), you will have
to enable the JMX to get this information displayed through Lambda Probe. This
can be done by adding the JAVA_OPTS variable to the catalina.bat file. The
following code line enables the JMX for Tomcat.

set JAVA_OPTS=%JAVA_OPTS%-Dcom.-sun.management.jmxremote

Besides monitoring real-time Tomcat parameters, Lambda Probe application also
provides options to view the logs on real-time basis, to see what and where the
problem has occurred. Also the app deployer facility is handy to directly deploy
the Web archive applications through the Probe.

Conclusion
Through Lambda Probe, a Tomcat administrator can effectively monitor the
production server environment where the situations like memory shortage for
Tomcat apps, or sessions expiring before user’s request, etc. can be averted
beforehand.

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.

Your data will be safe!Your e-mail address will not be published. Also other data will not be shared with third person.