[SOLVED] Virtio Ballon Issue on Ubuntu?

killmasta93

Renowned Member
Aug 13, 2017
959
56
68
30
Hi,
Currently was seeing on the proxmox dashboard high end of memory RAM, it was odd because i have 80 gigs of ram with arch of 4 gigs running on ZFS. i checked a vm which has 2 gigs of ram i check on the dashboard of proxmox and it shows 1.69 gigs consuming but on the vm it says 500mb

it shows that it has the drivers but not sure what i missed?

Code:
root@medusa:~# cat "/boot/config-`uname -r`" | grep -i vir
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_PARAVIRT_SPINLOCKS=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
CONFIG_VIRT_TO_BUS=y
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_VSOCKETS_COMMON=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=m
CONFIG_VIRTIO_BLK_SCSI=y
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_NET=m
CONFIG_CAIF_VIRTIO=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
CONFIG_DRM_VIRTIO_GPU=m
# CONFIG_FB_VIRTUAL is not set
CONFIG_SND_SEQ_VIRMIDI=m
CONFIG_SND_VIRMIDI=m
CONFIG_SND_VIRTUOSO=m
CONFIG_DMA_VIRTUAL_CHANNELS=m
CONFIG_VFIO_VIRQFD=m
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO=y
# Virtio drivers
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_RPMSG_VIRTIO=m
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_CRYPTO_DEV_VIRTIO=m
CONFIG_VIRTUALIZATION=y
CONFIG_DMA_VIRT_OPS=y
root@medusa:~# lsmod | grep balloon
root@medusa:~# grep -i virtio /boot/config-$(uname -r)
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_VSOCKETS_COMMON=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=m
CONFIG_VIRTIO_BLK_SCSI=y
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_NET=m
CONFIG_CAIF_VIRTIO=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_DRM_VIRTIO_GPU=m
CONFIG_VIRTIO=y
# Virtio drivers
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_RPMSG_VIRTIO=m
CONFIG_CRYPTO_DEV_VIRTIO=m
root@medusa:~# htop
root@medusa:~# grep -i virtio /boot/config-$(uname -r)
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_VSOCKETS_COMMON=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=m
CONFIG_VIRTIO_BLK_SCSI=y
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_NET=m
CONFIG_CAIF_VIRTIO=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_DRM_VIRTIO_GPU=m
CONFIG_VIRTIO=y
# Virtio drivers
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_RPMSG_VIRTIO=m
CONFIG_CRYPTO_DEV_VIRTIO=m


Code:
root@medusa:~# /sbin/lsmod | grep vi
virtio_net             45056  0
virtio_blk             20480  2
 
Proxmox is showing buffered/cached RAM as used RAM. If proxmox shows 1.69 gigs used but on the vm it says 500mb used, that VMs is probalby using 500MB for system/services + 1,19GB for buffering/caching.

If you got 80GB of RAM and don't manually changed the max ARC size, ZFS will use 40GB of that RAM für its ARC by default.
 
Last edited:
thanks for the reply, i also have another VM that i have 40 gigs of ram on the vm it shows 8 gigs but is it really possible using 32 gigs of buffering/cache? see pictures
1609606112034.png
1609606090515.png
 
What OS is that VM? Unix will use everything you assign, even if it don't need it.
If it is Windows you need to install all virtio drivers and make sure the qemu guest agent service is running.
 
its a ubuntu 18.04 server but not sure how its using everything if it shows only 8 gigs of the 40
 
so this is the vm which has the 2 gigs and also running ubuntu 18.041609611190401.png

Code:
root@medusa:~# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.9G        349M        202M         57M        1.4G        1.3G
Swap:          2.0G        524K        2.0G

1609611159196.png
 
So the 1,7 of 2G is right if you add the buff/cache.

Whats the free -h output of the VM with the 40GB RAM?
 
so i dropped it down to 35 gigs of the vm, what i dont understand is the buff/cache? what does that do?

this is the output so in reality the vm is using 3.6 gigs plug the 8.2 gigs?

Code:
root@postgre:~# free  -h
              total        used        free      shared  buff/cache   available
Mem:            33G        3.6G         21G        1.4G        8.2G         28G
Swap:          2.0G          0B        2.0G
 
Most OSs will use every RAM you assign to it. If the system or programs don't need that free RAM it will be used to cache/buffer files so they can be read from RAM instead of from HDD/SSD and speed up your system. Your VM is using 3.6G for system/programs + 8,2G for caching files. So it is using 11.8G of RAM and only 21G are unused. But if system/programs needs more RAM and free RAM is low it will free up some of that buffered/cached files. Thats why you got only 21G free but 28G available, because 7GB of that 8.2G buff/cache can be free if needed.
 
Last edited:
oohh gotcha gotcha but that is how linux works because windows works?
so even if the 21gigs free and are not being used it still consumes on the host?
 
oohh gotcha gotcha but that is how linux works because windows works?
All common OSs are using RAM as file cache like that. Unix and Windows too.
so even if the 21gigs free and are not being used it still consumes on the host?
That depends on the OS. For FreeBSD for example everything is consumed. If you give a FreeBSD 35GB of RAM it will reserve 35GB and the host or any other VM can't use anything of that 35GB. Even if the FreeBSD-VM only is using 1GB of those 35GB.
With Linux and Windows it looks to be different. These are only reserving as much RAM as they need, so if the guest don't uses 21GB of the 35GB RAM most of that 21GB RAM should be available for the host or other VMs to be used.

If you want to be safe don't give the VMs more RAM they really need. Your 35GB VM will run with only 6GB too. Or give it 12GB if you want it to buffer alot. But 35GB is just a waste ressources. The more RAM you give a VM the more it will buffer and the less RAM is available to other VMs or the host.
 
Last edited:
  • Like
Reactions: killmasta93
thanks for the reply, o gotcha gotcha, i tried lowering to 15 gigs but the zabbix server would not run so smoothly i let it in 35 gigs i think the buffer/cache does work in way
 
My Zabbix server with 30 clients is running with only 2,5G RAM. I think lowering the RAM shoudn't be the problem.
 

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!