1

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.

Purres
  • 239
  • 1
  • 4
  • 18

2 Answers2

3
 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
gunwin
  • 6,400
  • 3
  • 19
  • 22
0

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.

devicenull
  • 5,622
  • 1
  • 26
  • 31