Dec 16 2008
Choose the right VPS to host your busy websites
I have a few busy websites running Wordpress, phpBB, phpList, eTicket, Magento and other PHP/MySQL based scripts. I get close to 1M hits a month with a peak observed at 9 hits/second. A shared hosting won’t work for me anymore. A dedicated server is too expensive and perhaps an over-kill. So I set off to find a VPS (Virtual Private Server) 8 month ago. It’s a quest full of frustrations and learning. I’ll write my experience down here in hope that it can be of some use to others about to start a similar quest. I’ll cover two primary issues:
- Picking the right VPS, and
- Running a light system
VPSLink referral/promotion code: CSR42P 10% lifetime discount.
How to pick the right VPS
I first started with a HostIcan VPS-Rage (512MB RAM) using Virtuozzo virtualization. It came with a reseller package which I don’t need and it gave me a lot of headache in setting things up. The performance of the applications was unpredictable, in the sense that response latency could be unbearably long (>15 seconds) or reasonably fast (~1 second). Apache log showed many child processes being terminated. I wasn’t sure whether this was because of either my VPS being deprived of CPU or hiccups of Apache.
The last straw came when I changed the MySQL root password and the monitoring software kept restarting MySQL every 10~15 mins. And I was demanded $30 to reset MySQL password. No, I wouldn’t give in to this type of bullying behavior and decided to move on. To make it the worst experience to me, HostICan won’t refund the remaining 6 month fee. Their “Risk Free Money Back Guarantee” only applies to the first 30 days. Buyer beware!
Virtuozzo/OpenVZ gives you a bit speed but not stability
After realizing that life with a VPS is a bumpy ride, I tried to understand virtualization better. Virtuozzo is the commercial version of OpenVZ by Parallels. It runs a single instance of OS and claims to offer the highest levels of density, performance and manageability. However, a fatal drawback is that each Virtuozzo VPS does not have virtual memory, but rather some additional burstable RAM. The burstable RAM are shared by all VPS on the same server.
When RAM on a server is exhausted, malloc() return an error and it is upto applications to handle the error gracefully. Without exception, applications terminate with or without core dump. When memory leak is still common (e.g. in PHP) and server setup is done by armatures (e.g. configuring 256 Apache processes), the chance for RAM exhaustion is pretty high. This may explain why I saw many Apache child process termination on my HostIcan VPS.
Xen is the right choice
While stability being an issue with Virtuozzo or OpenVZ based VPS, the alternative is Xen. Xen is fundamentally different from Virtuozzo or OpenVZ. Xen provides a hardware emulation and each VPS runs its own instance of OS, with virtual memory. When the allotted RAM is used up, the OS starts swapping. It slows down the system but no sudden death occurs. This is the same predictable behaviour of a dedicated server. The following diagrams from VPSLink.com explains the differences pretty well.
After much search and research, I found VPSLink which has good reviews and reasonable pricing. BTW, when checking out hosting companies, it’s useful to have a read of their facilities and look at the server room pictures. Pay particular attention the rack structure, heat vents, raised floor and wiring neatness. I managed to filter out a couple of hosting company showing Wal-mart racks on wheel, bare floor, hairy wiring and Linksys routers.
I signed up for VPSLink Link-4 Xen package ($30/month, 512M RAM) and installed Fedora 8. Fedora 8 is in the same blood line of the vetted Redhat Enterprise Linux 5 (Fedora 11 will be in EL6 to be released 2010). I have faith in its stability as I deployed multi-million dollar servers with Redhat EL5 to top tier mobile operators around the world before.
So far, VPSLink’s service is excellent. I asked for IP address reverse mapping and it was done in 10 minutes. If you want to sign up with a VPSLink package, use the referral/promotion code CSR42P. You’ll get a 10% lifetime discount and I’ll get some credit to my package. Don’t feel obliged if there’s a better deal.
Read the Part 2 of this quest: Speedy ride on a VPS with Lighttpd


