views:

313

answers:

2

I am doing some experimentation with VPS before moving my application from private Tomcat hosting to cloud. It is a read intensive app built on Struts 2 + Spring + Hibernate + MySql. Its a moderately popular app in India with 1500 visitors and 10,000 pageviews per day. I have some basic questions about choosing a server configuration.

1) Would it be enough to have 256M RAM for running both Tomcat and Mysql. I wont be running anything else other than SSH. No apache, FTP etc. My current heap size is 190M. can i still set the heap size as 190M with 256M RAM? What are the pros and cons?

2) Is it better to have 2 256M servers one with Tomcat and one with Mysql? or 1 server with 512M running both MySql and Tomcat?

I am open to any suggestions. Thanks!

+1  A: 

1)

I think it could be done.. I've seen a similarly sized app running on 256MB Linux VPS.

However, you're leaving very little memory for MySQL, which will cause it to have to go to disk often. It could be quite slow.

2)

One server is better than two. You have less to configure and you don't pay for the OS + virtual machine container overhead twice. Also, your app server and your database may not use equal memory, so being on separate machine could be an inefficient use of memory.

Joel
2 256MB servers are the same cost as 1 512MB server. Would you still recommend going with one server. I thought MySql will be happy to be on its own.
Aravindan R
Is the contention ratio (or allowed cpu time) of the 256MB server half that of the 512MB? You might find you get more of *something* (disk space, traffic allowance, etc) by getting the two smaller servers. Otherwise I don't think there is any advantage.
Joel
Assuming pricing is 2 servers = $2X and one 512 meg server = $2x and in all other respects they are the same the 2 small servers get you more cpu/disk, but increased overhead (MySQL is no longer local, it's on another VPS which may or may not be on the same physical box. OTOH with two machines you can build some redundancy in (i.e. MySQL master/slave to hot backup the data).
Kurt
A: 

I don't believe a 256MB VPS can effectively run a Java WebApp. You need at least a 512MB VPS. I wouldn't consider splitting until you go past a 1GB container. When you split, you have the overhead of the OS running 2x. One of the advantages of splitting though, is you may have more burst-able capacity. If the two VPS are on separate hardware and you get a rush of traffic, you may be able to use more CPU cycles than a single container on a single host. This depends on the load of the other containers of course, and your VPS provider's policy on bursting.

brianegge