mrd081
mrd081

Reputation: 279

JVM, Tomcat on 64 bit Linux

On 32 bit systems, JVM has a memory limit of 1.5 to 2 GB. What is a good value of JVM memory on 64 bit Linux ? How that can be mapped to maximum number of threads and maximum requests in tomcat ?

I am using JDK 6+ and tomcat 7. RAM available will be 12 GB on a quad core processor.

MRD

Upvotes: 1

Views: 1664

Answers (2)

Moataz Elmasry
Moataz Elmasry

Reputation: 2519

I don't think there's an out of the box answer to this question. This depends heavily on what kind of applications you are going to host and how much is it going to be on your system. I administer a small server with 3-4 applöications on a 64bit linux system. Using 4GB is more than enough for me.

My advise is make a wild guess how much ram is required for your applications. Then startup tomcat with a monitor tool then watch how much load is there on your tomcat. You might have allocated too much resource for tomcat. Maybe too few. you never know

Please read this article on Simultaneous users, and also the article about load balancing in tomcat

Basically you have to differentiate between users and requests. you might have 5000 users browsing your site, but only 100 making requests for a new page at one moment. By default tomcat supports 50 concurrent requests (not 100% sure though). But this number can be changed in your tomcat configuration. Obviously you might need more hardware. In the second article, max 200 requests per tomcat instance is recommended. only simple calculation rules as mentioned in the second article and doing some monitoring can help.

There's even a load balancer manager for tomcat. Check it out load balancer for tomcat

One more thing to think of, is although you have the hardware and the right load balancing to support 5000 users, you also need enough bandwidth to do so. Again explained in the second article "load balancing in tomcat"

Good luck

Upvotes: 3

meadlai
meadlai

Reputation: 935

It depends on how many users will visit you application simultaneously.

Sometimes, the app will run very slowly at a particular time point,

For instance, at 8:00 AM, login action causes the app can't stand.

I suggest you to estimate average memory per user, according the “total number of users",

Then you may get a nearly almost RIGHT memory setting.


Upvotes: 1

Related Questions