Performance and scalability: Will having two TomCat improve the application performance?
Hi All, Currently, my application are using 1 Tomcat to do database transaction.However, the performance are very low. I'm thinking of having another Tomcat in the same machine. Does having two Tomcats in one machine will improve the application performance? thank you, fairuz
- Posted by: ahmad fairuz
- Posted on: January 08 2007 03:30 EST
Currently, my application are using 1 Tomcat to do database transaction.However, the performance are very low. I'm thinking of having another Tomcat in the same machine. Does having two Tomcats in one machine will improve the application performance?It depends on where the bottleneck is. If the application is slow with only a few users, then it is unlikely that adding another Tomcat will solve the problem. Try this: 1) While the app is running slowly, look at the database utilization. If it is very high (close to 100%) then the database is likely the bottleneck. 2) Otherwise, if the db utilization is low, then check the CPU utilization on the Tomcat box. If the Tomcat utilization is high, then you might be able to solve the problem by adding another Tomcat server (on a separate box). 3) Otherwise, if both utilizations are low, then look for problems such as poor configuration, e.g. too few db connections in the pool. Peace, Cameron Purdy Tangosol Coherence: Clustered Cache
My plan is to put the other Tomcat in the same box. I'm afraid adding another Tomcat will utilize more on the CPU.Its like adding another thread of application. Do you think adding another Tomcat will be advisable to help improve the CPU utilisation ? Does this is a smart way to resolve the problem?
Start by following the steps that I suggested, and let me know what you find. Peace, Cameron Purdy Tangosol Coherence: Java Data Grid
Try as Cameron pointed out. However, if the problem is in DB due to poor SQL or poor configuration, then adding another Tomcat instance might degrade the performance as well. So I would recommend to find out where the bottleneck is rather than simply increasing the tomcat count. You can add some performance counters around your sql code to know the time taken for the sql. (well...there are various ways to do this. This is the most straight forward one). ~Rajesh.B