Balloning & swappiness


May 28, 2021

tl;dr: How does swap and swappiness affect ballooning growth?

I have a few VMs running Alpine Linux 3.15/3.16/3.17 and have over-provisioned the ram with the Ballooning device ticked.

Most of them have the minimum ram set to between 512 and 4096 MB, with the maximum up to 75% of the host's RAM based on projected need.

All of them have their root disks on the mirrored SSD rpool/zfs-local, /var on a separate disk image on the same pool and /data on the big spinny disk pool

Inside the VMs they are all set up with a swap partition that setup-alpine makes when installing the OS.

I have noticed that ballooning works when giving memory back to the host/other VMs but to make it grow, I have to initially set actual to a value greater than minimum memory manually before it will happen automatically.

If I don't run balloon= in their monitor tab the VMs will swap out memory until swap is full then go oom at minimum memory allocation.

Because of this I've never low/out of memory on the host but often do inside the VMs. So, questions:
  1. How does SWAP affect balloon growth?
  2. Would it be more performant to turn off swap inside the VMs?
    1. Alternatively, should I set swappiness to a lower number inside the VMs than on the host?
    2. Alt-alternatively, should I mount SWAP as tmpfs inside the VMs?


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!