mike-p
Enthusiast
Enthusiast

Confusing swap stats

I have an ESXi host which show temporary swap in but no swap out stats.

How is this possible? Before data can be swapped in to memory again there musst be a swap out of the data to disk.

mike-p_1-1615221309323.png

 

yello : swap in

green : swap out

black : consumed host memory

 

Reply
0 Kudos
vbondzio
VMware Employee
VMware Employee

Chances are that the swap out happened earlier. Log into the host via SSH and run e.g.:

memstats -r vm-stats -s name:b:memSize:min:max:consumed:ballooned:balloonTgt:swapTgt:swapped:active:touched:zipped:zipSaved:shared:zero:sharedSaved -u mb 2> /dev/null | sed -n '/  \+name/,/ \+Total/p'

To check memory stats of your running VMs.

View solution in original post

Reply
0 Kudos
mike-p
Enthusiast
Enthusiast

Hi,

i waited for 1 month and checked the stats again. I have no swapped memory anymore only some small ballooning amounts.

Thanks for your advice. I will check from the console when swapping occurs again.

Reply
0 Kudos
vbondzio
VMware Employee
VMware Employee

If shitwap happens, you can always unswap after taking care of the cause (contention / limits etc.): http://www.yellow-bricks.com/2016/06/02/memory-pages-swapped-can-unswap/

Reply
0 Kudos
mike-p
Enthusiast
Enthusiast

Update:

now i have a new situation. I have a small amount of swapped memory. This is not a problem but i want to be aware which view i con trust.

mikep_0-1645450832531.png
mikep_2-1645451129439.png

 

 
mikep_1-1645451025338.png

 

 

 

Reply
0 Kudos
vbondzio
VMware Employee
VMware Employee

One is the absolute value of swapped out VM memory, the other is a rate over a period. Both are accurate, either the period selected is too short to cover when the swap happened or the period is to long and the rate over the sample trending to 0.

Reply
0 Kudos
mike-p
Enthusiast
Enthusiast

Yes, it seems that there  are only stats about swap rates in KBps. The ammount of swapped memory (like ballooned mem)  is missing.

Reply
0 Kudos
vbondzio
VMware Employee
VMware Employee

The default metrics for roll up (non real time) stats where decided upon a long time ago, I can't comment on the reasoning but would also prefer read and write swap rate over a single current swap value. There is no equivalent for Ballooning so the current ballooned value it is.

Reply
0 Kudos