I'm trying to size a tomcat cluster. The key factors will most likely be:
- The size of clustered in-memory cache we decide to use. So for example, if we wanted to support 100GB in-memory cache, then we might need 50 instances (assuming 2GB max heap size), across perhaps 5 servers (assuming 24GB RAM).
- The request latency, against some pre-defined target.
- The CPU.
Considering the latter, during load testing we are monitoring top.
For a 2 CPU x 8 Core server, we are seeing, for example:
top - 15:49:34 up 99 days, 3:00, 5 users, load average: 1.51, 1.16, 1.04
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.5%us, 0.1%sy, 0.0%ni, 98.4%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 24551264k total, 6872016k used, 17679248k free, 702612k buffers
Swap: 10731412k total, 0k used, 10731412k free, 4487096k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18227 tomcat 18 0 1751m 857m 11m S 26.0 3.6 3:15.96 java
For the number of users in our load test, we don't seem to be CPU bound, but if we increased the number of users, which would be the most useful statistic in sizing?
- The load average?
- The CPU %us / %id values?
- The tomcat process %CPU?
Thanks.
The process %CPU is how much the process is using on the core it's running on. The other CPU headers are for all cpu's/cores. This is not a simple answer as the scaling of tomcat can be simple, but it's really a matter of the apps that will be running inside of tomcat that will determine the scaling. Some apps use more CPU than others and some use more memory or network IO than others. Unless you have performance metrics and usage stats on the apps that will be running this is a wait and see scale as needed scenario.