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.

 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


 actual 8388608
 swap_in 189132507715
 rss 1945288

I suspect you're confusing things here. virt-df will show you the disk space inside the guest. virt-top will show you what resources the guest is using on the host. The 'less then 1%' you refer to indicates the guest was not using very much of the host's resources.

There is no way to tell from outside a KVM instance what processes are running, or what percentage of CPU/memory they are using. KVM instances are basically a black box as far as the host is concerned.

  • "virsh dommemstat [name]" returns the actual memory a vm is using. – Purres May 28 '14 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.