Tomcat Tuning Approach

Tomcat Clustering

A cluster is a group of servers connected together that can perform similar functionality. They are generally connected to each other through high speed Ethernet. Clusters are highly used in security areas, financial & banking sectors and so on. Benefits of Clustering includes high performance, high availability, scalability etc.

Few Clustering Technologies Include:

DNS request distribution

Usually DNS server is configured to give one IP address for one Apache httpd server instance. With DNS request distribution, we can configure to give three IP addresses. Each address is allocated to a separate httpd or tomcat instance.

NAT (TCP Network Address Translation) request distribution

DNS may give many IP addresses to various browsers. But the initial IP address could be answered by NAT request distributor. NAT distributor can act as a gateway to many servers behind it. We can utilize this type of distributor to resolve failover and load balancing issues.

mod_proxy_balancer load balancing

If you would like to run many instances of Tomcat behind httpd instances then you need to use mod_proxy_balancer to distribute all the requests. It is also useful to keep various requests from being distributed to failed instances of Tomcat.

Troubleshooting

Troubleshooting is an art of resolving crucial issues and is an impeccable part of Tomcat tuning. It is not possible to troubleshoot any issue by just referring to the problem statements. You have to narrow down the problem to its root level and solve it. Slowness of application is a major issue that makes it very difficult for administrators to solve. In many cases, the components of a web application such as the operating system, database and the web server are responsible for slowness.

End-User Troubleshooting

Here you need to perform the following steps:

  1. Application could be accessed from the browser and you can check how much time it takes to load the page.
  1. Check the ping response of the server from the user side. An appropriate response denotes that the connectivity for server and user machine is good.

Web Server Troubleshooting

Here we have to dig down in the server to check whether there are any issues.

  1. If the web server process is running, check how many processes are running by using the command: ps –aef|grep httpd. This command shows all the processes running for the Apache httpd server. If they are greater than 50, it indicates that there is an issue such as high user traffic, high CPU utilization or high disk I/O.
  1. You can also check memory status and CPU utilization to see if any Apache processes are consuming a high CPU usage by using appropriate commands.
  1. You must verify Apache logs and look for errors in the error and access logs.

Java Based Applications

In case of Java based applications, slowness is caused due to the issues such as improper application deployment, JVM memory and incorrect DB configuration.

  1. Check Java processes and the load average for the instance machine by using the command ps –ef|grep java. The load average can give you substantial clues.
  1. Check the Tomcat logs that could be found in TOMCAT_HOME/logs and search for the exceptions.

Pages: 1 2 3

Leave a Reply

Your email address will not be published. Required fields are marked *