views:

196

answers:

1

A while back I was using Virtual Private Server (VPS) that had very limited RAM. I used it to host Jetty. It was so slow that it became completely unusable. I believe the main problem was memory-related. I switched the project over to PHP and the problems disappeared.

Needless to say, I'm very hesitant to try Java again in a VPS. Even though the RAM in my VPS is significantly higher, it seems like PHP is streamlined for low RAM. Has anyone tried a VPS with a Servlet container and had a lot of success? Could it have been something simple with my Java config? Is PHP usually the better choice for a small VPS deployment?

+1  A: 

ServerFault may be a better place to ask that than here, but in my experience 128 is dreadfully low. I run a Tomcat instance on a Linode VPS with 1 gig of guaranteed memory and haven't had any issues. The particular site in my case also has very low traffic, so I can't vouch for it under heavy loads

The 'Burst' signifies that your VPS may be given access to more than your 128 megs at times (depending on the overall server usage). For a server instance, access to this memory should be considered unreliable and your better off assuming the worst case scenario of only having 128 megs.

In other words, pay more for more memory =)

Edit: Ask and ye shall receive. Top reports 1025 megs virtual memory, and 416 megs reserved. It's by far the largest memory hog running on my VPS.

Jason Nichols
Thanks for the insight. Out of curiousity, can you tell me how much RAM your tomcat instance is using? Or better yet, how much available RAM is left after tomcat and friends (apache/mysql/etc) are up.
User1
As more anecdotal evidence, I get by with a tomcat install with a single app (and apache and mysql) running in a 512mb prmgr.com instance.
lucas
That sounds like a bit more than 128MB :)
User1
I'm pretty sure you can get by with less than a Gig, but I wanted to play it safe since it's a revenue generating site. Regardless, I'm nearly positive that 128MB won't cut it =)
Jason Nichols
I have a java application running on 256MB of VPS with 768MB burstable ram. Works perfectly fine but as soon as deploy 2 applications , start running into out of memory issues.
vsingh