We have Dell PowerEdge Dual Processor Machine with 1GB RAM.
We are using tomcat 4.1.29 server for running struts-based application. Application needs to support around 4000 user simultaneoulsy with moderate response time.
should i increase number of maxProcessor and minProcessors
for connector in server.xml file for more performance if yes how much it should be?
Besode it how can i utilize my system to full potential
1- You should change the jvm parameters to take advantage of your 1G Ram
2- you could also configure multiple tomcat instances along with in memory session replication.
We are currently testing the multiple instances on tomcat on the same box using 4.1.27 but we are going to use sticky session with apache and the modjk connector because I thought tomcat session replication was only introduced in 5. Can you explain the memory session relplication.
So does the new Tomcat 5.0 use the JavaGroups jars for their session replication or do they use another method or implementation?
Application needs to support around 4000 user simultaneoulsy with moderate response time.
1) Do you want to support 4000 concurrent sessions?
2) Are you expecting 4000 HTTP requests per minute?
Or 4000 HTTP requests per second?
Although you can get tips and tricks here a good place to start is tomcat documentation and performance tuning guides. It takes couple of hours of reading but bottom line you should be able to understand what parameters you are changing for your application
You can tune your JVM as well as App server and the database if you have one
Few parameters you can play with are
# of threads or thread pool, based on user need and availbility you can allocate
heap size ( not recommended beyond 75% of available memory)
Frequency of garbage collection - depends on how long each session (4000) would typically last
This is basic tuning. You can tune the app server for execute queues, detect/release stuck threads, connection pools etc. Your requirements define what you can do.
Have to agree with previous posts.
Setup your tomcat to a large chunk of memory if you can, to handle the possible large number of sessions needing replication "CATALINA_OPTS=-server -Xms768m -Xmx768m".
Storing 4000 session objects within tomcat shouldn't be a problem (unless you are going to be putting heavy objects into each session) - as long as the session per user doesn't contain too much data.
The real question, listed previously, is how many "truely concurrent users".
You really need to know how many users "per second" or at least "per hour" are comming onto the system. Only from this can you see how many threads you are going to need for tomcat.
A possible starting point, 4000 users per hour (thats 1.11 users "per second" accessing your system).
Assume a "burstiness" ratio of 3-4 (this is a fudge factor to account for uncertainties, and that you never get a real average.) this gives 4.44 users "per second" worst case.
Need to know worst possible query response time - lets assume 2 seconds for tomcat/struts to serve up a response (use of agressive caching to achieve this, can hopefully be done). This means you need to handle 8.88 users simultaneously at any moment in time. Tomcat would need 10 worker threads dedicated towards handling requests.
Should users per hour go up, or response increase, you'll need more threads.
Main points - keep your request time as low as possible (agressive caching / good design), and make sure you are running in server mode (easy to forget, we have on many occaisons! And it makes a hell of a difference)
and make sure you are running in server mode (easy to forget, we have on many occaisons! And it makes a hell of a difference)
Also you might want to give JRockit a chance. Last time I checked the difference between Sun JVM and JRickit, simply using it gave me a certain performance boost (around 50% even better). Used Tomcat5 though.