VMware Cloud Community
zenomorph
Contributor
Contributor
Jump to solution

Memory ballooning simulation........

I'd like some help, is it possible to write a vbscript that can generate some memory load on a server.

I know there's a vbscript called cpubusy.vbs which can be used to generate cpu load on a server. Is there something equivalent for RAM load I can use for testing.. I want to see how the "memory balloning" works when an ESX host is under memory constraint.

Cheers

1 Solution

Accepted Solutions
AntonVZhbankov
Immortal
Immortal
Jump to solution

Just create one dummy VM with a lot of memory and set Memory Reservation for it to a level you want. This makes memory unavailable for all other VMs and looks like heavy memory load.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda

View solution in original post

0 Kudos
3 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

try HeavyLoad, it may be useful

0 Kudos
RParker
Immortal
Immortal
Jump to solution

I know there's a vbscript called cpubusy.vbs which can be used to generate cpu load on a server. Is there something equivalent for RAM load I can use for testing.. I want to see how the "memory balloning" works when an ESX host is under memory constraint.

It's a pretty simple concept. If you have a server with 16GB of RAM. And let's say for simplicity you have 16VM's each configured with 1GB RAM each. Now each VM get's busy, and needs it's full complement of RAM. ESX ramps up, allocates the RAM to each VM.

Initially since the ESX server is fairly idle as far as RAM, then there is plenty of RAM available for EACH VM. As the ESX host gets full, let's say the threshold for this is 90%. 90% of 16GB is 14.4GB. So around 14 VM's (yes I know about sharing, and VM's not being a pure 1:1 for RAM, but this is a simple test) the ESX server will be full. So at this point it triggers the balloon.

It forces the VM's to inflate their RAM to 1GB or whatever is free, to force their swap/paging to kick in. Thus this forces the VM's to use the vswp file and NOT use available RAM on the host, therefore decreasing the RAM load on the ESX host, and freeing up more RAM for other VM's. ESX is 'smart' in that it knows how much is allocated, how much is granted and how much is used by EACH VM, so it won't deflate those balloons until there is sufficient RAM (not locked) to allocate.

So that in a nutshell is how it works. By installing tools in the VM's that are up to date, you are ensuring proper commuication, and thus ballooning, monitoring, driver support etc are fully supported, that's why tools are integrally important.

This doesn't include reserved memory however, which doesn't apply. Reserved memory is reserved. If you have 16 VM's with 1GB RAM each and your ESX server only has 16GB of RAM physically available, then those 16 VM's are all you will be able to start. That's why its important to keep the reservations, sizing of VM's and RAM requirements to a minimum so you can use the ESX server to it's best optimization.

0 Kudos
AntonVZhbankov
Immortal
Immortal
Jump to solution

Just create one dummy VM with a lot of memory and set Memory Reservation for it to a level you want. This makes memory unavailable for all other VMs and looks like heavy memory load.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
0 Kudos