Console Login
Home / Blog / Server Administration / OpenVZ Containers: The Good, The Bad, and The Oversold
Server Administration 9 views

OpenVZ Containers: The Good, The Bad, and The Oversold

@

OpenVZ Containers: The Good, The Bad, and The Oversold

It is the classic dilemma for any system administrator in 2011: you need to deploy a LAMP stack for a new client, budget is tight, and you see VPS offers for $15 a month claiming 2GB of RAM. It sounds perfect. You provision it, install CentOS 5, and get to work.

Two weeks later, MySQL crashes. No error log entries. Just a silent death. You restart it. It crashes again during peak traffic. You check free -m and it says you have plenty of memory. What is going on?

Welcome to the world of OpenVZ and the dark art of "Burst RAM."

At CoolVDS, we believe in transparency. While we offer various virtualization technologies, understanding the architecture under the hood is the only way to make an informed decision for your infrastructure, especially here in Norway where uptime isn't just a metric—it's a reputation.

The Architecture: Chroot on Steroids

OpenVZ is not hardware virtualization (like Xen or KVM). It is operating system-level virtualization. It partitions a single physical server into multiple "containers" (VEs). They all share the same Linux kernel.

This approach is brilliant for efficiency. There is no overhead of emulating hardware or booting a separate kernel for every client. This allows providers to pack hundreds of containers onto a single host node.

The Pros: Efficiency and Agility

  • Raw Performance: Because there is no hardware emulation layer, CPU and I/O performance is often near-native—assuming the host node isn't overloaded.
  • Instant Provisioning: An OpenVZ container can be created in seconds.
  • Dynamic Resource Scaling: You can change the resources allocated to a container without rebooting it. Need more RAM? A simple change on the host node applies it instantly.

The Cons: The "Noisy Neighbor" and Kernel Limits

However, the shared kernel is also the Achilles' heel of OpenVZ, particularly for high-performance hosting.

1. The Memory Lie (User Beancounters)

In a standard Linux environment, if you run out of RAM, the system swaps. In OpenVZ, memory management is controlled by /proc/user_beancounters. Providers set a "Guaranteed" limit and a "Burst" limit.

Here is the trap: Software like Java or huge MySQL InnoDB buffer pools often try to allocate memory upfront. If they hit the 'privvmpages' limit defined in your beancounters—even if physical RAM is free—the allocation fails. Your application crashes, often without a clear 'Out of Memory' error in the usual logs.

Pro Tip: If your OpenVZ service is acting strange, run cat /proc/user_beancounters. Look for the last column named failcnt. If it is anything other than 0, you are hitting a hard limit imposed by your host, regardless of what top tells you.

2. Kernel Modules and IPTables

Need a specific kernel module for a VPN tunnel or a custom firewall rule? With OpenVZ, you are stuck with whatever kernel version and modules the host provider has loaded (usually a RHEL/CentOS 2.6.18 or 2.6.32 kernel). You cannot modprobe your own modules. If you need advanced networking or specific file system tuning (like EXT4 barriers), you are often out of luck.

A War Story: The Magento Meltdown

We recently migrated a client running a Magento e-commerce store. They were hosted on a budget OpenVZ provider in Germany. Every time they sent a newsletter, the site went 503.

The culprit wasn't PHP. It was the disk I/O. Another customer on the same physical node was running a massive backup script, saturating the SATA bus. Because OpenVZ file systems are just directories on the host's file system, there is less isolation for Disk I/O compared to KVM. The "Noisy Neighbor" effect killed their sales.

We moved them to a CoolVDS KVM instance backed by our high-performance storage array. The result? Page load times dropped from 4 seconds to 0.8 seconds. Stability returned.

Regulatory Implications in Norway

For our Norwegian clients, data integrity is paramount under the Personopplysningsloven. While OpenVZ is secure when configured correctly, a shared kernel theoretically presents a larger attack surface. If a vulnerability is found in the host kernel, it could potentially affect all containers. For banking, healthcare, or sensitive data handling, full hardware virtualization (KVM/Xen) is the recommendation to satisfy the strict requirements of Datatilsynet.

Comparison: OpenVZ vs. CoolVDS KVM

Feature OpenVZ KVM (CoolVDS Standard)
Kernel Shared with Host Dedicated (Customizable)
Isolation Process Level Hardware Level
Performance Native (unless oversold) Near-Native (stable)
Swap Fake/Virtual Real Dedicated Swap
Cost Lowest Medium

Verdict: When to Use What?

Use OpenVZ if:

  • You need a massive number of small instances for testing (DNS servers, small proxies).
  • Cost is the absolute primary factor.
  • You are running standard, low-resource Linux applications.

Use CoolVDS KVM/Xen if:

  • You run a business-critical application (Magento, heavy MySQL, Tomcat).
  • You need to tune kernel parameters (sysctl) or load custom modules.
  • You need guaranteed disk I/O and RAM that cannot be stolen by neighbors.
  • You require strict data isolation for compliance.

Final Thoughts

Don't let the allure of cheap "Burst RAM" compromise your stability. In the hosting world, you generally get what you pay for. If you are ready to move beyond shared kernels and experience true isolation with low latency connectivity to Oslo and the rest of Europe, it is time to upgrade.

Need true isolation? Deploy a CoolVDS KVM instance with high-speed 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