Memory Ballooning clearing the cache too slow on Debian VM

tyjtyj

New Member
Feb 7, 2022
9
3
3
42
My machine has 16GB ram(Virtual Environment 7.2-7).
VM1 given 2GB and 6GB ballooning enabled(qemu agent enabled).
During midnight VM1 will run backup which consuming all 6GB and mostly cache
Code:
               total        used        free      shared  buff/cache   available
Mem:            5035        1622         129           1        3283        3130
Swap:            975          24         951

We can see that it s over 3GB as cache.
This resulting my host ram usage at 82.17% (12.74 GiB of 15.51 GiB)

When it come to day, VM2 start consuming the RAM slowing given 2GB ballooning to 8GB.
As the VM2 memory slowly increasing host memory reach over 95% over few minute.
I can see VM1 start to deflate but very slowly.

VM1 freeing up the cache fast enough, this resulting OOM kill VM1.

I can turn on swap to prevent this but it just continue to consume swap instead of freeing memory on VM1.

Is there a way to set memory deflate aggressiveness ? or start deflating at maybe 70%

VM2 which is windows took only 2 minute to fully deflate the ram.

This is last 2 log(5min interval) taken before OOM killed VM1
Code:
root@VM1:~# free -m
               total        used        free      shared  buff/cache   available
Mem:            5414        1635         495           1        3284        3497
Swap:            975          24         951
root@VM1:~# free -m
               total        used        free      shared  buff/cache   available
Mem:            4716        1647         407           1        2661        2791
Swap:            975          26         949


Update, found 80% is hard coded ?

https://git.proxmox.com/?p=pve-mana...34d21f851030c017ba7;hb=refs/heads/master#l191
 
Last edited:
  • Like
Reactions: leesteken
You can edit this file on your local installation, it should be in /usr/share/perl5/PVE/Service/pvestatd.p. Don't forget to restart the pve service.
Be careful, it shouldn't break your system, but you never know : )
 
  • Like
Reactions: leesteken
Thanks you both for the information. With ZFS, where cache is counted as used memory instead, one might want to increase it. I'll see if I run into problems when setting it to 90%.
 

About

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!