Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect RAM usage on FreeBSD 12.2 / 13.0 #19

Open
Onepamopa opened this issue Apr 15, 2021 · 9 comments
Open

Incorrect RAM usage on FreeBSD 12.2 / 13.0 #19

Onepamopa opened this issue Apr 15, 2021 · 9 comments

Comments

@Onepamopa
Copy link

For some reason Proxmox VE shows ram usage at least 2x (even more) what the actual usage is on FreeBSD 12.2 / 13.0.
Guest agent is configured as "VirtIO" (possible option is also "ISA") in PVE.

@aborche
Copy link
Owner

aborche commented Apr 15, 2021

hm. i think this is not a guest-agent problem

$ virsh dommemstat freebsd12.2-zfs
actual 1048576
last_update 0
rss 1108384

can you diff memory usage from proxmox and virsh output ?

@Onepamopa
Copy link
Author

Onepamopa commented Apr 15, 2021

virsh: Command not found.

Looks like Proxmox doesn't use virsh (libvirt).
Any way of checking directly in guest ?

Looks like Proxmox itself doesn't query memory usage via the agent. I'll open a topic in their forum.

qm agent testvm dommemstat
command: value 'dommemstat' does not have a value in the enumeration 'fsfreeze-freeze, fsfreeze-status, fsfreeze-thaw, fstrim, get-fsinfo, get-host-name, get-memory-block-info, get-memory-blocks, get-osinfo, get-time, get-timezone, get-users, get-vcpus, info, network-get-interfaces, ping, shutdown, suspend-disk, suspend-hybrid, suspend-ram'

@Onepamopa
Copy link
Author

Onepamopa commented Apr 15, 2021

Looks like I've used the wrong command, but in any case:

qm guest cmd 104 dommemstat
command: value 'dommemstat' does not have a value in the enumeration 'fsfreeze-freeze, fsfreeze-status, fsfreeze-thaw, fstrim, get-fsinfo, get-host-name, get-memory-block-info, get-memory-blocks, get-osinfo, get-time, get-timezone, get-users, get-vcpus, info, network-get-interfaces, ping, shutdown, suspend-disk, suspend-hybrid, suspend-ram'

get-memory-block-info and get-memory-blocks both return:
"error" : {
"class" : "CommandNotFound",
"desc" : "The command guest-get-memory-blocks has been disabled for this instance"
}
"error" : {
"class" : "CommandNotFound",
"desc" : "The command guest-get-memory-block-info has been disabled for this instance"
}

https://forum.proxmox.com/threads/freebsd-guest-wrong-ram-usage.87693/

@aborche
Copy link
Owner

aborche commented Apr 15, 2021

I need more info about memory usage calc in proxmox. Memory commands in qemu guest agent uses sysfs data and cannot be directly used in BSD. We need workaround for it.

@juliokele
Copy link

juliokele commented Apr 29, 2021

I need more info about memory usage calc in proxmox. Memory commands in qemu guest agent uses sysfs data and cannot be directly used in BSD. We need workaround for it.

proxmox use qemu-monitor-command "info balloon" for memory usage calc

info balloon command result, Ubuntu 20.04 guest:
balloon: actual=2048 max_mem=2048 total_mem=1986 free_mem=197 mem_swapped_in=6311936 mem_swapped_out=23953408 major_page_faults=3095 minor_page_faults=588652947 last_update=1618556301

info balloon command result, FreeBSD 12.2 guest:
balloon: actual=3072 max_mem=3072
missing parameters for measure the memory usage:
total_mem, free_mem, mem_swapped_in, mem_swapped_out, major_page_faults, minor_page_faults, last_update

@aborche
Copy link
Owner

aborche commented May 5, 2021

huh

I did a deep analysis and got several answers.

All requested info comes from kernel balloon driver/module.

The FreeBSD kernel does not have the features found in the virtio_balloon linux driver.

https://github.com/torvalds/linux/blob/v4.15/drivers/virtio/virtio_balloon.c
https://github.com/freebsd/freebsd-src/blob/main/sys/dev/virtio/balloon/virtio_balloon.c

If FreeBSD committers commit their changes, I think all additional information will appear automatically.
I think we can make some changes to the FreeBSD kernel, but this is not part of qga.

@juliokele
Copy link

Thank you for the research work!

"I think we can make some changes to the FreeBSD kernel"
it would be nice if you could...

@juliokele
Copy link

huh

I did a deep analysis and got several answers.

All requested info comes from kernel balloon driver/module.

The FreeBSD kernel does not have the features found in the virtio_balloon linux driver.

https://github.com/torvalds/linux/blob/v4.15/drivers/virtio/virtio_balloon.c
https://github.com/freebsd/freebsd-src/blob/main/sys/dev/virtio/balloon/virtio_balloon.c

If FreeBSD committers commit their changes, I think all additional information will appear automatically.
I think we can make some changes to the FreeBSD kernel, but this is not part of qga.

@aborche
Is there any news?

@7909linder
Copy link

Hi,

@aborche @juliokele
I'm facing the same issue, any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants