unswap ESXi 6

unswap available on esxi6

# memstats -r vm-stats -u mb -s name:memSize:max:consumed:swapped
name memSize max consumed swapped
-----------------------------------------------------------
vm.6954 8172 2000 2000 6300

show you swapped size

name memSize max consumed swapped
-----------------------------------------------------------
vm.6954 8172 -1 2000 6300

to unswap 2GB of it use following command:

# localcli --plugin-dir=/usr/lib/vmware/esxcli/int vm process unswap -w 6954 -s 2 -u GB

Monitor the process on vmkernel.log:

# tail -F /var/log/vmkernel.log | grep Swap
2016-07-05T16:25:45.256Z cpu1:256480)Swap: vm 6954: 4588: Starting prefault for the reg file
2016-07-05T16:28:23.356Z cpu3:256480)Swap: vm 6954: 5056: Finish swapping in reg file. (faulted 12544 pages, pshared 0 pages). Success.

Check then again the memstats:

name memSize max consumed swapped
-----------------------------------------------------------
vm.6954 8172 -1 4052 4300

now you see that this swapped size now is smaller by 2GB, so you can do then until swapped size will be 0

Speichere in deinen Favoriten diesen permalink.

Kommentare sind geschlossen.