Tomcat and MySql on VPS

I am experimenting with VPS before moving my application from a private Tomcat host to the cloud. This is a reader application built on Struts 2 + Spring + Hibernate + MySql. This is a moderately popular app in India with 1,500 visitors and 10,000 page views per day. I have some basic questions about choosing a server configuration.

1) Is it enough to have 256M RAM to run Tomcat and Mysql. I will not run anything other than SSH. No apache, FTP, etc. My current heap size is 190 million. can i set heap size as 190M with 256M RAM? What are the pros and cons?

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

I am open to any suggestions. Thanks!

+3
source share
2 answers

1)

I think it can be done. I saw a similar sized application running on 256MB Linux VPS.

However, you leave very little memory for MySQL, which will cause it to access the disk frequently. It can be pretty slow.

2)

One server is better than two. You have fewer settings, and you do not pay for the overhead of the container of the OS + virtual machine twice. In addition, your application server and your database may not use equal memory, so there may be inefficient memory usage on a separate machine.

+2
source

, 256MB VPS Java WebApp. 512 VPS. , 1 . , , 2x. , . VPS , , , . , , VPS .

0

Source: https://habr.com/ru/post/1720250/


All Articles