Difference between revisions of "Virsh dommemstat"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code>[[virsh]] dommemstat</code> get [[memory]] stats for a running domain/VM.
+
{{lc}}<code>[[virsh]] dommemstat</code> get [[memory]] stats for a running domain/VM.
 
* Doc: https://libvirt.org/sources/virshcmdref/html-single/#sect-dommemstat
 
* Doc: https://libvirt.org/sources/virshcmdref/html-single/#sect-dommemstat
  
Line 10: Line 10:
 
  [[swap_in]] 0               
 
  [[swap_in]] 0               
 
  swap_out 0             
 
  swap_out 0             
  major_fault 913         
+
  [[major_fault]] 913         
  minor_fault 247449     
+
  [[minor_fault]] 247449     
 
  unused 694704           
 
  unused 694704           
 
  available 1014852       
 
  available 1014852       
Line 65: Line 65:
 
* <code>[[virsh dominfo]]</code>
 
* <code>[[virsh dominfo]]</code>
 
* [[virsh domstats --memory]] ([[Libvirt release notes|Added in v6.0.0 (2020-01-15)]])
 
* [[virsh domstats --memory]] ([[Libvirt release notes|Added in v6.0.0 (2020-01-15)]])
 +
* [[Virt-top]]
  
 
== See also ==
 
== See also ==

Latest revision as of 09:16, 17 January 2024

virsh dommemstat get memory stats for a running domain/VM.

Syntax:

  • virsh dommemstat DOMAIN_NAME [--period seconds] [[--config] [--live] | [--current]][1]

Example:

# virsh dommemstat YOUR_VM_NAME          
actual 1048576          
swap_in 0               
swap_out 0             
major_fault 913         
minor_fault 247449    
unused 694704          
available 1014852       
usable 732936          
last_update 1514452854  
rss 537524             

Availability of these fields depends on hypervisor. Unsupported fields are missing from the output. Other fields may appear if communicating with a newer version of libvirtd.

For QEMU/KVM with a memory balloon, setting the optional --period to a value larger than 0 in seconds will allow the balloon driver to return additional statistics which will be displayed by subsequent dommemstat commands. Setting the --period to 0 will stop the balloon driver collection, but does not clear the statistics in the balloon driver. Requires at least QEMU/KVM 1.5 to be running on the host.

The --live, --config, and --current flags are only valid when using the --period option in order to set the collection period for the balloon driver. If --live is specified, only the running guest collection period is affected. If --config is specified, affect the next boot of a persistent guest. If --current is specified, affect the current guest state.

Both --live and --config flags may be given, but --current is exclusive. If no flag is specified, behavior is different depending on the guest state.

Examples[edit]

# virsh dommemstat YOUR_VM_NAME          
actual 1048576          
swap_in 0               
swap_out 0             
major_fault 913         
minor_fault 247449    
unused 694704          
available 1014852       
usable 732936          
last_update 1514452854  
rss 537524             

Output explained:

# virsh dommemstat YOUR_VM_NAME          
actual 1048576          # Current balloon value (in KB)
swap_in 0               # The amount of data read from swap space (in kB)
swap_out 0              # The amount of memory written out to swap space (in kB)
major_fault 913         # The number of page faults where disk IO was required
minor_fault 247449      # The number of other page faults
unused 694704           # The amount of memory left unused by the system (in kB)
available 1014852       # The amount of usable memory as seen by the domain (in kB)
usable 732936           # The amount of memory which can be reclaimed by balloon without causing host swapping (in KB) *
last_update 1514452854  # Timestamp of the last update of statistics (in seconds)
rss 537524              # Resident Set Size of the running domain's process (in kB)


Activities[edit]

  1. Use virsh dommemstat to view memory assigned to your VM or virsh dominfo VM_MACHINE | grep memory


Related commands[edit]

See also[edit]

  • https://rentry.co/bmpsn
  • Advertising: