VPS on OpenVZ: when a container is enough and where it lets you down
OpenVZ is container virtualisation for Linux, long developed by Virtuozzo. All customers on a physical server run on the host's single kernel, and the kernel itself isolates memory, processes and networking. This lets one machine hold many containers, which is why OpenVZ plans remain among the cheapest in the table. The low price comes with limitations, and it is important to understand them before buying rather than after.
OpenVZ 6 and OpenVZ 7: the kernel version decides everything
Inside a container, the uname -r command shows the host kernel, and that is what determines what will run for you.
- OpenVZ 6 runs on kernel 2.6.32 from the RHEL 6 branch, a string like
2.6.32-042stab…. This kernel stopped being developed long ago, and modern distributions don't boot on it: recent versions of systemd and glibc need newer kernels. Such plans usually offer only old OS templates without security updates. - OpenVZ 7 is based on kernel 3.10 from RHEL 7 (the output will contain
vz7). Newer systems work here, but the kernel is still older than many programs expect, and only the host can change it.
Another consequence of the shared kernel: the host synchronises the server's time, so you can change the system time zone but not adjust the system clock. For most tasks this doesn't matter, but programs that manage time themselves won't work in a container. If the plan description doesn't state the version, ask support or check uname -r on the very first day, while the refund period is still running.
What you can't do in a container
- Load a kernel module.
modprobedoesn't work: only modules the host has enabled on its side are available. So WireGuard for a private network between servers is possible here only in its userspace variant and only if the TUN device is enabled; for that task the VPS for WireGuard selection is more convenient. - Install a different OS. Windows, FreeBSD and custom ISOs are ruled out: a container always stays Linux on someone else's kernel.
- Run virtual machines. There is no nested virtualisation in a container, and there can't be.
- Configure swap and some sysctl settings. There is no swap partition of your own, and many kernel network parameters, including the choice of TCP algorithm, are set by the host.
- Rely on Docker. Modern Docker doesn't start on OpenVZ 6; on OpenVZ 7 its support depends on the host's settings and is often limited in networking and storage drivers.
Memory and overselling: read user_beancounters
Historically OpenVZ was known for "burst" memory: a plan listed a guaranteed amount and a larger one available "while there is free memory". In practice the extra disappeared at peak hours. OpenVZ 7 has a simpler scheme: a memory limit plus virtual swap (vswap), which free shows as ordinary swap. But it is not your server's disk: when it is used, the host deliberately slows the container down.
The best tool for checking is the /proc/user_beancounters file. For each resource it shows current usage, the limit and a failcnt column: how many times the container has hit the limit. A growing memory failcnt explains sudden MySQL or PHP crashes better than any application log. CPU and disk on OpenVZ are shared with neighbours especially tightly, so stability on cheap plans varies noticeably over the day.
How to check that a plan really runs on OpenVZ
The systemd-detect-virt command prints openvz. Indirect signs are the presence of /proc/vz and /proc/user_beancounters, and a venet0 network interface instead of the usual eth0. Sometimes it is the other way round: the host just says "VPS" without naming the platform, and a container turns out to be inside. If you need your own kernel, look for the KVM label straight away: there Docker, kernel modules and any OS are available without caveats.
When OpenVZ is still a sensible choice
A container is a good fit for tasks that need nothing from the kernel: a static site behind nginx, a small Python bot, a scheduled script, a test environment for a week, a backup monitoring point. If the budget is minimal and the software is ordinary, OpenVZ 7 will cope, and such a server costs less than a KVM equivalent; other low-cost options are collected in the cheap VPS section.
Don't take OpenVZ for a production database, a Docker stack, a corporate private network or a project that is going to grow. Moving later will cost more than you save. If you want a container but with a modern kernel, look at VPS on LXC: the limitations are similar, but the host kernel is usually much newer.