check a vps guest memory usage and CPU usage

7,457
 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
Share:
7,457
Purres
Author by

Purres

Updated on September 18, 2022

Comments

  • Purres
    Purres almost 2 years

    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
    Purres about 10 years
    "virsh dommemstat [name]" returns the actual memory a vm is using.