• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the average memory to be put in place for a Tomcat Webapp to run fluently?

 
Carlos Conti
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have recently developed an internal application in my company. It has been developed with rudimentary equipment, like no specialized dev machine, we have a regular laptop as the tomcat server.

We have developed with Vaadin and MySQL. The point is that I am about to finish with the OutOfMemory errors (thanks to VisualVM), so heap memory seems to be contained but the problem is now performance. Querying ttakes very long. I have to say aswell that the MySQL server is running in the same machine, so it is perhaps a bit overloaded with the whole thing.

However I wanted to ask for advice of an experienced administrator for a recommended architecture to adopt if I want to give service as a start to a group of 25 concurrent users. Should I split the web and database processing to two different machines?. In that case what would be the recommended requirements for both machines. In case one machine is sufficient, what minimum requirements would be desirable.

Now I have a Windows 8 Machine with 4GB of RAM memory. I have set the max memory usage for the VM to 2GB. It is clear to me that this is not the adequate equipment and a lot of processes running in the machine should be switched off to release CPU power. Is Linux a better alternative regarding performance?.

The idea is to escalate this application to a gradually increasing user base. So I would like to have an idea of what is the minimum machine I should put in place.

If anybody knows any resource where this kind of discussions are hold, or any good books focused in web app deployment it would be of great help to me.

Many thanks for your time and advise.

Regards,

Carlos.

 
Dmitri Tikhanski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all I would start with simulating expected load of 25 requests/second. Given you use Java I recommend to use Apache JMeter to create the load. Constant Throughput Timer allows to precisely set arbitrary load so you should be able to exactly replicate real life load pattern.

Second: 25 concurrent users is a very low amount for machine with 4Gb RAM, Amazon Micro instance having 512Mb should be capable of surviving more load so I think that Tomcat and MySQL configurations are not optimal. You could use a profiler tool like YourKit to take snapshots and investigate problematic classes, methods and fields keeping large objects.

From MySQL point of view I believe that "large" configuration preset is a good thing to start with. Enabling slow query log can also reveal long-running queries so you should be able to inspect them and see how they can be improved (i.e. query redesigned, indices added, etc.)

Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!