Cheap VPS with 2 GB RAM under $6: what fits and where the savings hide
Two gigabytes of memory for up to about $6 a month is a range where plans with the same figure in the description behave very differently. At one host it is an honest 2 GB on KVM, at another it is a container in which part of the memory is handed out "when available" and the file cache counts against your limit. The difference does not show on the day of purchase but a month later, when the server has accumulated a database and logs.
What really fits into 2 GB
The rule of thumb is simple: one main service with a database, or several light processes without one. This amount suits:
- a PHP site with MySQL or PostgreSQL and up to several thousand visitors a day;
- two or three bots with a shared SQLite or Redis database;
- a corporate WireGuard VPN for remote access to office servers;
- monitoring such as Uptime Kuma or a Zabbix proxy for a small fleet of machines;
- a practice lab for Linux, nginx and Ansible.
Windows Server, Java applications, frontend builds with webpack or Vite and any stack where the database takes more than a gigabyte will be cramped. If any of these is in your plans, go straight to cheap VPS with 4 GB: moving the server two months later will cost more than the price difference. A detailed memory budget per process is on the VPS with 2 GB RAM page; this page is about not overpaying and not getting it wrong with a budget plan.
KVM and OpenVZ: the same 2 GB is counted differently
On KVM the virtual machine gets its own slice of memory and its own Linux kernel. Everything inside is yours: the kernel decides how much to give to the disk cache and how much to programs, and when memory runs short it starts paging out to swap. The free -h command shows about 1.9 GB total, and the figure does not change during the day.
On OpenVZ and LXC the kernel is shared with the node's other customers, and your limit is set by the container settings. There are three unpleasant features here:
- The file cache counts towards the limit. A database reading heavily from disk or large logs eat into the container's memory even though the programs use less.
- Guaranteed and burst memory. A plan may promise 2 GB of which only one gigabyte is guaranteed, while the rest is given by the node as long as the neighbours have spare capacity.
- Someone else's OOM. When memory runs out, the kernel kills a process inside the container, and the cause is not always visible in your system's logs.
In the budget segment containers are noticeably more common than in the expensive one, and the virtualization type is sometimes not stated in the plan description at all. After purchase you can check it with systemd-detect-virt: the answer kvm means a full machine, openvz or lxc a container.
Swap on a small server
On KVM you set up swap yourself. For 2 GB it makes sense to create a 1–2 GB file, and if the disk is slow or small, try zram: compressed swap in memory gives one and a half to two times more headroom for text data and barely touches the disk. A vm.swappiness value around 10–20 keeps swap for peaks rather than for constant use.
On OpenVZ there is no swap of your own. A Swap line may appear in free, but it is virtual paging controlled by the host: when it is used, the node deliberately slows the container down. You cannot create a swap file with swapon inside the container. If the project relies on paging to survive rare peaks, a container is a poor choice here.
How to compare plans within this budget
- Billing period. The low price is often given for paying a year ahead. Check the monthly price and whether you can get money back for unused months.
- Cores. 2 GB usually comes with one core. That is enough for a site; for compressing backups and encrypting traffic for dozens of users, two are better.
- Disk. On a small server memory and disk are linked through cache and swap, so SSD or NVMe matters more here than on a big one.
- IPv4. Some plans come with IPv6 only or a shared address, and part of your users will not be able to connect to such servers directly.
- Snapshots and backups. On cheap plans they often cost extra or are missing. If you will make copies yourself, reserve disk space and external storage.
- Traffic. A cap of a few hundred gigabytes is enough for a site and bots, but not for a corporate tunnel for the whole office or regular off-site backups.
After purchase, give the server a load close to the real one and look at steal in top and at the available line in free -h. If the first days pass without OOM and lag, the plan fits; if not, it is better to leave straight away while there is little data on the server.