Console Login
Home / Blog / Server Administration / OpenVZ Containers: Performance Myths and Production Realities
Server Administration 8 views

OpenVZ Containers: Performance Myths and Production Realities

@

The Truth About OpenVZ and Resource Isolation

Let’s be honest. If you have been in the hosting game for more than a week, you have seen the advertisements. "512MB RAM VPS for $3/month!" It sounds like a steal. But when your MySQL replication lag hits the ceiling or your Apache processes start dying with cryptic memory errors, you realize that bargain came with a hidden cost: OpenVZ overselling.

At CoolVDS, we deploy OpenVZ for specific use cases, but we refuse to play the game of "mathematical impossibility" that many budget providers in the Nordic market rely on. Today, I’m going to break down exactly how OpenVZ works, why /proc/user_beancounters is the most important file you’ve never looked at, and when you should stop pinching pennies and move to hardware virtualization (Xen/KVM).

The Architecture: Shared Kernel vs. The World

OpenVZ is operating-system-level virtualization. Unlike Xen or KVM, which emulate hardware and run a dedicated kernel for each guest, OpenVZ containers sit directly on top of the host's Linux kernel. This architecture is brilliant for density. A host node can run hundreds of containers with near-zero overhead.

However, this shared kernel is a double-edged sword. If one container on the node kernel panics, the whole node can go down. More importantly, resource isolation is soft. In a Xen environment, RAM is RAM. In OpenVZ, RAM is often a promise that can be broken.

Pro Tip: If you need to load custom kernel modules (like specific IPTables modules for a VPN or specialized tunnel), OpenVZ will fight you. You are at the mercy of the host node's configuration. For deep kernel customization, always choose KVM.

The "Burstable" RAM Myth

You will often see specs listed as: 256MB Guaranteed / 512MB Burst. This concept of "Burst" memory is unique to the container world. It allows you to use extra RAM when the host node has it available. It sounds great until Monday morning when everyone on the node checks their email and hits the database simultaneously.

When the host runs out of real RAM, the kernel invokes the OOM (Out of Memory) killer. In an OpenVZ environment, the container exceeding its "Guaranteed" limit is usually the first to get shot. Your site goes dark, not because you misconfigured Apache, but because your neighbor is running a memory-leaking Minecraft server.

The Nightmare of User Bean Counters (UBC)

If you are managing an OpenVZ VPS, you need to know about the UBC. These are limits set by the host on everything from open files to TCP socket buffers. I recently debugged a Magento installation for a client in Oslo that kept crashing during traffic spikes. The RAM looked fine. The CPU was idle.

The culprit? numtcpsock.

Check your own limits by running this command:

cat /proc/user_beancounters

You will see output looking like this:

       uid  resource           held    maxheld    barrier      limit    failcnt
      101   kmemsize        2738902    2740211   14336000   14665728          0
            lockedpages           0          0        256        256          0
            privvmpages       41256      41298      65536      69632       1304
            numproc              23         23        240        240          0
            tcpsndbuf        214500     214500    3194880    5242880          0
            tcpsrcbuf             0          0     319488    5242880          0
            ...

See that failcnt column? That is the "fail count." If that number is anything other than zero, your application requested a resource and was denied by the hypervisor. In the case above, privvmpages (allocated memory) hit the barrier 1,304 times. That is 1,304 times an application potentially crashed or behaved unpredictably.

Why Storage I/O is the Real Bottleneck

In 2011, CPU is rarely the bottleneck for web servers; disk I/O is. On a crowded OpenVZ node with standard SATA drives, the "Noisy Neighbor" effect is brutal. If one user decides to run a massive backup or compile a kernel, the disk wait (I/O wait) for everyone else skyrockets. Your site loads slowly, Google crawls you slower, and your SEO suffers.

This is why CoolVDS has invested heavily in SSD RAID-10 arrays for our premium tiers. While rotating rust (HDD) is fine for backups, production databases need the random IOPS that only solid-state storage can provide. We see latency drops from 200ms to sub-10ms just by moving MySQL partitions to SSD.

Data Sovereignty: The Norwegian Advantage

We are seeing stricter enforcement from Datatilsynet (The Norwegian Data Protection Authority) regarding where personal data lives. The Personal Data Act (Personopplysningsloven) makes it clear that you are responsible for your customer's data.

Hosting on a budget OpenVZ node in a random datacenter in Texas might save you 50 kroner a month, but it exposes you to latency issues across the Atlantic and legal gray areas regarding Safe Harbor. CoolVDS infrastructure is located right here in Oslo, directly peering with NIX (Norwegian Internet Exchange). This ensures your latency to Norwegian users is measured in single-digit milliseconds.

When to Use OpenVZ (and When Not To)

Feature OpenVZ Container KVM / Xen (CoolVDS Pro)
Performance Near Native (unless oversold) Consistent, Isolated
Kernel Shared (CentOS 5/6 mostly) Dedicated (Run FreeBSD, custom Linux)
Cost Low Medium
Reliability Variable (Noisy Neighbors) High

The Final Verdict

OpenVZ is not bad technology; it is just frequently abused technology. For a dev environment, a VPN, or a simple static site, it is incredibly efficient.

However, if you are running a business-critical application, you need guarantees, not probabilities. You need to know that your RAM is yours, and your disk I/O won't vanish because someone else is unzipping a 10GB log file.

At CoolVDS, we configure our OpenVZ nodes with conservative limits to prevent overselling, and we offer high-performance SSD KVM instances for those who need absolute isolation. Don't let your infrastructure be a gamble.

Is your current host showing a high failcnt? Deploy a test instance on CoolVDS today and experience the stability of non-oversold hosting.

/// 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