Ahosting Logo

VPS Hosting

Understanding KVM Virtualization

Where KVM sits between the two things either side of itSharedKVM VPSDedicatedOperating systemone, shared by hundreds ofaccountsyour own kernelyour own, on the metalResourcespooled, and a neighbourcan take themallocated to youall of it, all the timeYou can installnothinganythinganythingStill sharedeverythingthe physical host and itsdisksnothingVirtualisation gives you isolation from your neighbours. It does not give you a machine that cannot be affected bythem at all.

KVM gives each VPS its own kernel and its own allocated resources, rather than sharing one operating system between accounts. That single difference explains most of what people notice about a KVM server compared with the cheaper alternatives.

What it means in practice

Your memory is yours. Allocated, not shared and not oversold at the kernel level. A busy neighbour cannot consume it.

Your kernel is yours. You can load modules, run a different distribution, and configure the system as you like. Container-based virtualisation shares the host kernel and forbids most of that.

You can run anything the hardware supports. Any Linux, any software, any configuration. Including things that are genuinely awkward elsewhere, such as Docker or a custom network stack.

The trade is that a full virtual machine has more overhead than a container. In exchange you get isolation that holds under load, which is the property people are actually buying.

Where it differs from shared hosting

On shared hosting, hundreds of accounts share one operating system and one set of limits. Your site competes for the same PHP processes as everyone else, and you cannot install system software because it would affect them.

On a KVM VPS you have a machine. Nobody else's traffic touches your allocation, and there is no restriction on what you install.

What you gain in control you take on in responsibility: patching, configuring services, and recovering when something breaks are now yours. That is the actual difference between the tiers, and it is worth being honest about before moving. There is more in comparing the tiers.

Where it differs from a dedicated server

A dedicated server is the whole physical machine. A KVM VPS is a slice of one, with hardware-enforced separation between slices.

For most workloads the practical difference is capacity rather than behaviour. A dedicated server matters when you need the whole machine's performance, specific hardware, or single-tenancy as a requirement instead of a preference.

Snapshots

Full virtualisation makes it possible to capture the entire machine state and restore it. That is worth using deliberately.

Take a snapshot before anything risky: a distribution upgrade, a major software change, a configuration you are unsure about. Rolling back then takes minutes instead of rebuilding.

A snapshot is not a backup, though. It usually lives on the same infrastructure, so it protects against your mistakes rather than against infrastructure failure. Keep real backups elsewhere. For the distinction, see backing up your VPS.

What virtualisation does not give you

It does not make the server secure. A KVM VPS with password SSH logins and no firewall is compromised as readily as anything else, isolation from neighbours is not protection from the internet.

It does not make it fast. Your allocation is guaranteed; whether the application uses it well is a separate question.

And it does not maintain itself. The isolation is real and the patching is still yours.

Securing your VPS goes over the first hour of work, which matters more than the virtualisation technology underneath.

Confirm what you are actually running on

Providers describe products loosely, and the difference between a full virtual machine and a shared kernel is visible in one command.

systemd-detect-virt
lscpu | grep -i 'hypervisor\|model name'
uname -r

kvm means your own kernel. lxc, openvz or container means you are sharing the host's, which is a materially different product regardless of what it was sold as.

The consequence is practical rather than academic: on a shared kernel you cannot load a module, cannot change most kernel parameters, and cannot run anything that requires them, which includes some container tooling and some firewall arrangements, running Docker on a VPS is the case where it bites most often.

Memory is yours; the disk and the network are not

The allocation people are sold is memory and processor, and those are the resources the isolation handles well. Storage and network bandwidth are usually shared, and that is where a busy neighbour is still felt.

vmstat 5 5
iostat -x 5 3 2>/dev/null | tail -20

The steal column in the first shows processor time the host gave to somebody else. The wait figures in the second show time spent waiting on storage.

High wait with low processor use is the signature of shared storage under pressure, and no amount of application tuning changes it. Documented over a period, it is a specific thing to raise with the provider. Understanding load average and CPU steal explains reading the figures.

The virtual hardware has a performance setting

A virtual machine can present its disk and network either as emulated ordinary hardware or as devices designed for virtualisation, and the difference is large.

lspci | grep -iE 'virtio|ethernet|scsi'
ls /sys/block/ | head

Devices named virtio are the efficient kind. An emulated network card or disk controller works with any operating system and costs noticeably more processor time for the same throughput.

This is set by the provider rather than by you, and it is worth asking about when a machine performs worse than its specification suggests: particularly on an image built for compatibility rather than for speed.

What changing the specification actually involves

Resizing is not one operation, and the parts differ in how disruptive they are.

Memory and processors can frequently be added while the machine runs, though the operating system may need to be told to use them. Reducing either almost always requires a shutdown.

Disk is the one that catches people: the provider enlarges the virtual disk, and nothing changes inside the machine until the partition and then the filesystem are extended. A machine can sit with twice the disk it had and still report itself full: adding or resizing a disk on a VPS goes over the steps, and scaling and upgrading your VPS explains choosing what to change.