Apache Tomcat is one of the most widely-used servers in the realm of Java-based web applications. Apache Tomcat is an open-sourced server that is often used for important web applications for enterprise users. However, as with all virtual machine technology, using Apache Tomcat comes with a responsibility to monitor it properly. In this Tomcat monitoring guide, we’re going to look at how to monitor Tomcat and some of the tools you can monitor it with.
Here is our list of the four best Tomcat Monitoring Tools:
- SolarWinds Server & Application Monitor (FREE TRIAL) Tracks the activities of Tomcat and other applications and observers resource usage on the server that supports them. Runs on Windows Server. Start the 30-day free trial.
- ManageEngine Applications Manager (FREE TRIAL) Watches the threads of Apache Tomcat and raises an alert if performance dips or server resources run short. Available for Windows Server, Linux, AWS, and Azure. Install the 30-day free trial.
- Sematext Apache Tomcat Monitoring (FREE TRIAL) This system watches over your Tomcat server and is part of a package that can also monitor Apache Web Server and WildFly. Available as a SaaS package or a virtual appliance. Access the 14-day free trial.
- AppDynamics Automatic discovery plus application dependency mapping that includes live requirements forecasting implemented with AI. This is a SaaS package.
How do I Monitor Tomcat?
While network administrators on smaller networks may be able to get by on command-line scripts, ad-hoc monitoring isn’t the most efficient way to manage your resources. For more precise monitoring you will need to use an external monitoring tool. You have the choice between Java Management Extensions (JMX beans) or using a complete application monitoring solution. But before that, we’re going to look at what you should be monitoring.
What Should I be Monitoring with Tomcat?
Tomcat is a server all of its own. There are a number of metrics that you need to monitor to discover performance issues and maintain long-term performance. These are:
- Memory – One of the first things you should monitor is how much memory the server has available. A JVM with Low memory will lead to poor performance.
- Uptime – Measuring whether your server is up or down is essential for ensuring your service stays up. In the event that your monitoring tool reports that the service is down, you can start troubleshooting to find out why.
- Response time – The server should respond to user requests ASAP. If the response time is too long then you run the risk of losing users.
- Error rates – Recording the error rate shows you if there are any issues in your codebase. Monitoring error rates helps optimize your service.
- Request throughput – Monitoring request throughput tells you how many threads are active. If too many threads are active the application can perform poorly.
- Number of sessions – Measuring the number of sessions will tell you how many concurrent sessions the server can support simultaneously.
- Garbage collection – Garbage collection needs to be run at a certain frequency with the necessary amount of memory cleared once the collection is complete.
How to Query Tomcat Metrics with MBeans
If you’re using JMX beans to monitor Tomcat, you will be using JMX proxies to query metrics. However, in order to do this, you need to configure Tomcat and assign users and roles. You will need to configure the following roles: manager-jmx and manager-gui.
The first will enable the user to access the JMX proxy servlet and Tomcat’s server status; the latter allows the user to access the application manager where you can monitor for performance issues.
To assign a role to the user you need to update the conf/tomcat-users.xml configuration file and enter the following. (The command will create a new tomcat-jmx user, assign the roles listed above to the user and create a password for the account):
<role rolename=“manager-gui” /?> <role rolename=“manager-jmx” /> <user username=“tomcat-jmx” password=“<YOUR_PASSWORD>” roles=“manager-jmx,manager-gui”/>
To query Tomcat metrics you will need to access a JMX proxy servlet where you can query performance metrics via the web browser. Through your web browser, you can query the data of Mbeans or managed Java objects to view information about your server. You can view a list of MBeans available to monitor by entering the following:
When searching for an MBean you can add parameters to help you with your search. Parameters you can add to the command line include domain, type, name, and attribute. In the prompt these are as follows:
http://localhost:8080/manager/jmxproxy/?get=<DOMAIN>:type=<TYPE>, name=“ <NAME>”&att=<JMX_Attribute>
If you wanted to view the HTTP connector’s maximum request processing time you would enter the following:
The result would be the following:
OK - Attribute get 'Catalina:type=GlobalRequestProcessor,name="http-nio-8080"' - maxTime = 189
The limitation of using Tomcat to query metrics is that you can only look up one thing at a time. It is for this reason that we recommend using a third-party server monitoring tool to track multiple metrics simultaneously.
The best tools for monitoring Apache Tomcat
If you want to monitor a range of metrics simultaneously, then you’re better off with an application monitoring solution. One of the advantages of going this route is that you have a wide range of options to choose from in terms of providers.
Our methodology for selecting an Apache Tomcat monitor
We reviewed the market for Apache Tomcat monitoring systems and analyzed tools based on the following criteria:
- A system that can track thread performance
- Memory management tracking
- Dependency mapping
- Throughput tracking
- Capacity alerts to prevent service blackouts
- A free trial or a demo that creates an assessment opportunity
- Value for money from a system that will keep Apache Tomcat serving your websites
With these selection criteria in mind, we identified the best Apache Tomcat monitoring systems.
1. SolarWinds Server & Application Monitor (FREE TRIAL)
SolarWinds Server & Application Monitor is ideal for monitoring Tomcat because it comes with a set of out-of-the-box monitor templates built specifically for the server. The tool can monitor Free Memory, Total Memory, Max Memory, Total Processing Time, Request Count, Bytes Sent, Bytes Received, and Errors Count.
- Server resource tracking
- Memory management monitor
- JBoss monitor
- Data throughput recording
- Also monitors Geronimo
To make for a more compelling visual experience, SolarWinds Server & Application Monitor has out-of-the-box dashboards as well. The JBoss monitoring tools feature shows performance and usage data of Apache Tomcat and Geronimo.
There are also performance reports built especially for Tomcat and Geronimo. However, these can be customized if you want to monitor different information. Once you’ve chosen how you want reports to be structured you can automate the program to send them to certain users via email.
- Offers pre-built templates specifically for Tomcat monitoring
- Supports auto-discovery that builds network topology maps and inventory lists in real-time based on devices that enter the network
- Intuitive alerting and notification system
- Uses drag and drop widgets to customize the look and feel of the dashboard
- Robust reporting system with pre-configured reports for Tomcat and Geronimo
- Designed for IT professionals, not the best option for non-technical users
SolarWinds Server & Application Monitor is recommended to those who want to monitor Apache Tomcat with a tool that is easy to use. The software is competitively priced at $2,995 (£2,389) with enough pre-configuration to get you up and running swiftly. You can download a 30-day free trial.
SolarWinds Server & Application Monitor is our top pick for an Apache Tomcat monitoring system because it is able to identify the complexities of Java systems, their interactions with other resources, and the framework services that support them. Watch over the performance of threads and the usage and disposal of memory to ensure that the server will be able to continue to support the demands of your Tomcat-based Web assets and not run out of resources.
Download: Get a 30-day free trial
Official Site: https://www.solarwinds.com/server-application-monitor/registration
OS: Windows Server
2. ManageEngine Applications Manager (FREE TRIAL)
ManageEngine Applications Manager is an application monitor that can monitor Tomcat servers. The platform has the ability to monitor the CPU, memory, JVM usage, response time, and memory leaks. In addition, you can also monitor web application live sessions, JDBC connection pools, and thread pools. All of this data can be converted into graphs so that you can easily point to usage trends.
- CPU and JVM activity monitoring
- Memory management tracking
- Tomcat thread pool monitor
- Requirements forecasting
The Tomcat thread pool monitor is particularly useful because it allows you to monitor pool utilization. The program displays thread utilization stats on a graph with a list of metrics shown underneath. There is the option to configure alarms to alert you if certain parameters are met. You can also schedule thread dumps to make sure that your application server doesn’t get overwhelmed.
The tool also provides performance reports. Reports not only create a historical record for your performance data but also offer performance forecasting powered by machine learning. Forecasting can tell you whether you really need the server resources that you’re paying for. Once the report is generated it can be sent onward to your team.
- Offers on-premise and cloud deployment options, giving companies more choices for installation
- Can highlight interdependencies between applications to map out how performance issues can impact businesses operations
- Offers log monitoring to track metrics like memory usage, disk IO, and cache status, providing a holistic view into your Tomcat environment
- Leverages machine learning to monitor Tomcat thread pools, resource utilization, and JVM usage
- Can take time to fully explore all features and options available
ManageEngine Applications Manager is a tool designed for enterprises looking for application monitoring software that’s user-friendly. It has all the bells and whistles necessary to monitor Tomcat effectively with a competitive price point. The price ranges from $945 (£753) for 25 monitors to $7,195 (£5,740) for 250 monitors. The program is available on Windows and Linux. You can download the 30-day free trial.
3. Sematext Apache Tomcat Monitoring (FREE TRIAL)
Sematext Apache Tomcat Monitoring is part of a package of system monitoring tools delivered by Sematext under the package name Infrastructure Monitoring. The core package of this service monitors networks, servers, and applications and it can be extended by integrations, which monitor specific products. There is an integration for Apache Tomcat band also Apache Web Server and Apache WildFly, so you can track the performance of all of your Java Web applications and microservices through the Sematext package.
- Server performance monitoring
- Code profiling
- Distributed tracing
With the Sematext monitoring service, you can ensure smooth delivery of your Java applets and also track their activities when running on the Web. Your modules might have cohesion problems that slow down responses when they are used in conjunction with other systems on the Web and it is only when those functions are live that these issues can be encountered. The Sematext tool allows you to continue your testing while your Web applications are in service.
The Sematext includes a code profiler, so you can step through each line of code within your servlet containers as they operate. A distributed tracing system lets you watch the applications that your Tomcat-based code servers from start to finish. The Sematext platform includes a synthetic monitoring package and a real user monitoring service and you can add those modules on to the Infrastructure Monitoring package to get a full Web applications monitoring suite. Sematext also offers a log manager.
The Sematext Infrastructure Monitoring bundle watches over physical servers on your site and cloud platforms, including AWS, Google Cloud Platform, and Azure. This means that the service gives you full stack observability, which is ideal for root cause analysis when things go wrong. When there is a performance problem, Sematext will generate an alert and sense you a notification by email, Slack message, or Webhooks.
- Integrated full stack monitoring
- Live activity monitoring and historical analysis
- Storage for performance metrics
- The data retention service is the key element in the pricing structure
Sematext is a subscription service and the price you pay depends on the data retention period that you choose. If you can put up with only a 30-minute retention period, the system is permanently free to use – this is called the Basic edition. The Infrastructure Monitoring system is a SaaS package but you can choose to download the software and run it as a virtual appliance over Docker. You can get a 14-day free trial of the paid edition.
AppDynamics is an application performance monitoring solution that can monitor Apache Tomcat. AppDynamics can automatically discover application code on Tomcat and shows a top-down perspective on the performance of the entire service. With this tool, you can monitor the performance, availability, and health of your server.
- AI-based requirements predictions
- Application dependency mapping
- SLA baselining
You can also monitor for more specific issues as well. Heap usage, garbage collection, and memory leaks are just some of the tricky server issues that AppDynamics can handle. Leaks are monitored automatically and the user can be sent an alert if there is a problem.
To send alerts, AppDynamics uses SLA base-lining to discover performance issues the moment they occur. The responsiveness of the alerts system helps to address application issues before they affect the end-user. There is also root-cause analysis to help get to the source of any performance problems.
AppDynamics is worth considering for organizations that want a comprehensive Tomcat monitoring tool that provides transparency right to the heart of application processes. If you’d like to know the price of AppDynamics then you can request a quote from the sales team. There is also a free trial available.
Tomcat Monitoring Tip: Choose a Method You’re Comfortable With
Monitoring Apache Tomcat relies on tracking several very specific metrics that you might lose sight of without a complete server performance monitoring platform, whether you choose to use JMX beans or application monitoring tools. Of the application monitoring tools on this list, we would recommend SolarWinds Server & Application Monitor, ManageEngine Applications Manager, or AppDynamics on account of their usability.
The key is to make sure that you’re monitoring Tomcat in a way that is comfortable for you. If you prefer the oversight of an external application monitor then use a performance monitor. If you prefer to query MBeans manually then feel free to do things this way as well!
Related post: Apache Web Server Monitoring Tools
Tomcat Monitoring FAQ
How do I monitor Tomcat thread count?
It is possible to monitor Tomcat thread statistics through JMX, however, this can be difficult to set up. It is much better to use a monitoring tool that has specialized routines for Tomcat monitoring together with server and JVM monitoring capabilities.
How many sessions can Tomcat handle?
The number of sessions that a Tomcat instance can handle is dictated by the maxThreads setting. By default, this is 200 so you would need to change this value in order to get more sessions active. Reports from testers suggest that Tomcat can manage up to 13,000 threads, which, put in other terminology is 13,000 connections or 13,000 sessions.
How do I know if Tomcat is running?
The default port for Tomcat is 8080. To check if Tomcat is running, open any browser and enter the address http://localhost:8080. If Tomcat is running, you will see the Tomcat homepage in your browser. You might have set up Tomcat to run on some other port. If that is the case, enter that port number instead of 8080. You can see that port setting in conf/server.xml.