Check a vps guest memory usage and CPU usage

kvm-virtualizationlibvirtmemory usageUtilitiesvirtual-machines

I have vps guests that are managed by KVM and libvirt. Using virt-df, I am able to check the real disk usage of each vps guest.

#virt-df [--options] -d domname

Is there a similar utility tool to check memory usage and cpu usage?

I tried virt-top, but the cpu% and mem% it returned were mostly less than 1%, which was less accurate.

Best Answer

 virsh dommemstat <vm-name>

This will show the currect memory the vm is using, along with the total memory allotted to it.

Example: My vm name is testvm. so the command will be:

 virsh dommemstat testvm

Output:

 actual 8388608
 swap_in 189132507715
 rss 1945288