Console Login
Home / Blog / Server Administration / Stop Gambling with OpenVZ: Why KVM is the Only Choice for Production Systems in 2011
Server Administration 7 views

Stop Gambling with OpenVZ: Why KVM is the Only Choice for Production Systems in 2011

@

The "Burstable RAM" Lie is Killing Your Uptime

It starts with a slow query. Then, a 502 Bad Gateway. You check your logs, and there it is: Cannot allocate memory. But free -m says you have 512MB left. What is going on?

If you are hosting on a budget VPS, you are likely the victim of OpenVZ "beancounters."

In the current hosting landscape of 2011, too many providers in Norway and Europe are selling "containers" as "servers." They oversell RAM by a factor of 10, banking on the hope that not every customer will hit Digg or Slashdot at the same time. For a dev environment, that's fine. For a production MySQL database? It is suicide.

At CoolVDS, we have moved our entire fleet to KVM (Kernel-based Virtual Machine). Here is why the "Battle-Hardened" sysadmins are abandoning containers for true virtualization.

The Architecture: Shared Kernel vs. True Isolation

In an OpenVZ environment, you are not running a kernel. The host is. You are just a fancy chroot with a process ID limit. If a "neighbor" on the same physical node gets DDoS'd or decides to compile a custom kernel (which they can't do, by the way), your I/O wait spikes.

KVM is different. It uses the CPU's hardware virtualization extensions (Intel VT-x or AMD-V). Your operating system speaks directly to the hardware. If you want to run FreeBSD, you can. If you need to load a custom TCP congestion control module into the kernel for lower latency, you can.

Pro Tip: Check if you are on a real hypervisor or a container. Run uname -a. If you see a kernel version ending in "stab" or generic numbers that don't match your distribution's release, you are in a container. Real KVM feels like metal.

The War Story: Magento vs. The Bean Counters

Last month, we migrated a client running a Magento 1.5 store. They were on a "2GB RAM" OpenVZ slice from a competitor. Every day at 14:00, MySQL crashed.

We looked at /proc/user_beancounters. The provider had set the privvmpages limit lower than the advertised RAM. The system was killing the largest process (MySQL) not because the physical server was out of RAM, but because an artificial software limit said "Stop."

We moved them to a CoolVDS KVM instance with dedicated RAM. We tuned the InnoDB buffer pool in /etc/my.cnf to actually utilize the memory:

[mysqld]
innodb_buffer_pool_size = 1024M
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 2  # A fair trade-off for speed vs. ACID compliance

The result? Zero crashes. Page load times dropped from 3.2 seconds to 0.8 seconds.

Storage: The SSD Revolution

Latency is the enemy. Standard 7.2k RPM SATA drives are bottlenecks. Even 15k SAS drives struggle when 20 virtual machines try to write logs simultaneously. This is physical physics—a drive head can only be in one place at once.

This is why we are aggressively rolling out Solid State Drive (SSD) storage options. While expensive compared to spinning rust, the IOPS (Input/Output Operations Per Second) difference is logarithmic. A standard HDD gives you ~100 IOPS. An Intel 320 Series SSD gives you thousands.

If you are running a database-heavy application, raw CPU speed (MHz) matters less than I/O wait. Don't let your CPU sit idle waiting for the disk.

Data Sovereignty and The "Datatilsynet" Factor

Hosting outside of Norway brings legal complexity. With the increasing scrutiny from Datatilsynet (The Norwegian Data Inspectorate) regarding the Personal Data Act (Personopplysningsloven), knowing exactly where your physical bits reside is paramount.

When you use international clouds, latency to the Norwegian Internet Exchange (NIX) in Oslo can be 30-40ms. Hosting locally on CoolVDS keeps that latency under 5ms for domestic users. In the age of high-frequency trading and instant page loads, those milliseconds are revenue.

Conclusion: Stop Sharing, Start Owning

Virtualization technology in 2011 has matured. You no longer need to sacrifice performance for the flexibility of a VPS. But you must choose the right virtualization technology.

The Verdict:

  • OpenVZ: Good for testing, static HTML sites, and dev sandboxes.
  • KVM (CoolVDS): Mandatory for databases, Java applications (Tomcat/JBoss), and anything that requires kernel tuning.

Don't let a noisy neighbor take your business offline. Deploy a true KVM instance on high-performance SSD storage today.

/// TAGS

/// RELATED POSTS

Surviving the Spike: High-Performance E-commerce Hosting Architecture for 2012

Is your Magento store ready for the holiday rush? We break down the Nginx, Varnish, and SSD tuning s...

Read More →

Automate or Die: Bulletproof Remote Backups with Rsync on CentOS 6

RAID is not a backup. Don't let a typo destroy your database. Learn how to set up automated, increme...

Read More →

Nginx as a Reverse Proxy: Stop Letting Apache Kill Your Server Load

Is your LAMP stack choking on traffic? Learn how to deploy Nginx as a high-performance reverse proxy...

Read More →

Apache vs Lighttpd in 2012: Squeezing Performance from Your Norway VPS

Is Apache's memory bloat killing your server? We benchmark the industry standard against the lightwe...

Read More →

Stop Guessing: Precision Server Monitoring with Munin & Nagios on CentOS 6

Is your server going down at 3 AM? Stop reactive fire-fighting. We detail the exact Nagios and Munin...

Read More →

The Sysadmin’s Guide to Bulletproof Automated Backups (2012 Edition)

RAID 10 is not a backup strategy. In this guide, we cover scripting rsync, rotating MySQL dumps, and...

Read More →
← Back to All Posts