Average max concurrent users on Tomcat
I am doing stress test with JMeter
on web application (built with Spring, Struts2 REST, uses PostgreSQL).
I am simulating typical user's scenario with my app:
4 GET, 3 INSERT, 20 UPDATE calls.
Server specs:
4core Intel Xeon X5365 3GHz
8GB RAM
single 320GB SATA disk
OS: Ubuntu 8.10 32bit
DB: Postgresql 8.4
Tomcat 6.0.18
Java 1.6.0_14
The results show that server would handle around 130 concurrent transactions. Is this number possible? Are there any results开发者_开发技巧 online to compare with mine?
The bottleneck will be in your database so this is very hard to compare without knowing your database performance.
We have a similar machine (except with 16GB RAM, running Tomcat 5.5). In peak load, it can easily serve 256 simultaneous connections. We are debating to change the maxThreads to 512.
Some tuning tips,
- If you run Apache as front-end, use
mod_jk
. Its performance is much better thanmod_proxy
. - If you serve HTTP directly or use mod_proxy, use the NIO connector in Tomcat 6.
- Make sure your thread pool (maxThreads) is large enough, default is only 200.
- Make Tomcat state-less. Especially, don't use HttpSession. The state may cause memory leak in the app and degrade the performance gradually. Push all your state to database or client (cookies).
- Do use Database pooling (DBCP). We have MySQL, the JDBC driver is very chatty.
- If you run one instance of JMeter, it may become the bottleneck. Run multiple slaves from different networks to simulate real production load.
精彩评论