Apache Tomcat is a Java based web container that is used to host a variety of applications. In 1999, Tomcat was initially introduced to the open source group. Since then, it has been supported by the open source community and widely accepted in the IT industry. This project was actually developed by James Duncan Davidson (software architect at Sun Microsystems). James made his project open source and played an important role in donating the project to Apache Software Foundation. Since its donation, Tomcat has undergone rapid development in many areas from the developer community. Tomcat has redefined the meaning of Java server and it is one of the most widely used open source software packages. Let’s discuss the Tomcat tuning approach.
The Tuning Approach
Performance tuning plays an important role in running a web application without downtime. Tuning the server performance may vary from one application to the other. As each application has its own requirements, it is a tricky task to tune Tomcat.
By default, Tomcat packages are customized for the production run.
Why is it necessary to do Tomcat Tuning?
The answer to this question is very subjective. Each web application has its own requirements. Some applications may need high memory while others need less memory. The administrator has to tune Tomcat as per the requirement of an application. Performance tuning is still incomplete with JVM tuning. There are certain things that play a major role in the performance of an application such as database configuration, OS level setting and the hardware.
Aspects which can affect the Tomcat performance:
If the code is not developed properly, it may cause performance issues. For instance, if the database connection from the application code is not closed properly then a stale connection gets created in the database and the application runs slowly.
Middleware services may lead to application connectivity issues with the external interface. Now-a-days, many mobile applications use web services to connect to the server and fetch the application data. In this way, we are only exposing web services to the Internet and not the entire application server.
The database can cause major issues in the performance of an application hosted in the Tomcat server. If the query processing is slow then it sends a delayed response to all queries.
Every application has its own memory requirement. If an application has a very huge memory requirement and you have allocated less memory then you may face ‘out of memory’ issues.
Infrastructure issues may also affect the performance. If there is an Internet connectivity issue with the network or a packet drop in the network, it can degrade the performance.