VMware Cloud Community
BTuser9
Contributor
Contributor

Resource Allocation - CPU and Memory Limit not working for VMs

Hi Guys,

I have setup limit for CPU to 2048MHz and Memory to 1024MB for each VM through the vSphere's "Resource Allocation" feature. But it looks like it's not working. All the VMs are exceeding the limits and it's affecting the whole server. Can anyone tell me why it's not working? Am I missing anything? Please reply as soon as possible. Appreciate it.

Thanks,

Bhavik

0 Kudos
7 Replies
avlieshout
VMware Employee
VMware Employee

When you set a limit on memory, you are actually limiting machine memory usage. All memory above the limit will be provisioned from swap.

A limit lower than the configured memory will result in ballooning and swapping as soon as the guest wants to use more memory than the limit.

The guest only sees the configured memory and does not know about the limit!

Because the guest is tuning its memory management for the configured memory and doesn't know about limits, it's a bad practise to use limits.

The swapping on ESX level also lowers overal system performance.

If you need to control memory on a vm basis, change memory allocation.

Arnim

Sent from my iPad

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
BTuser9
Contributor
Contributor

Hi Arnim,

Thank you very much for your reply. We have several VMs under one ESX host and all of them are configured with 2GHz CPU and 1GB Memory. So accordingly for all the VMs we have set following through resource allocation:

                       Reservation          Limit

CPU(MHz)              0                      2048

Memory(MB)          0                     1024

However all the VMs exceeds the above mentioned limit, and one of the VM exceeded the CPU limit to the extent which resulted in a whole server crash. I don't understand how can the VMs exceed the above set limits? Appreciate your help.

Thanks,

Bhavik

0 Kudos
DSTAVERT
Immortal
Immortal

Why did you change the Resource Allocation? Unless you fully understand the ramifications and how it affects the VM you should not make changes to the resource allocation settings. How much RAM did you initially give the VM? How many vCPU?

-- David -- VMware Communities Moderator
0 Kudos
BTuser9
Contributor
Contributor

Hi David,

While creating VMs, each VM was given 2.53GHz of CPU and 1GB or RAM. There was no limit set to CPU and memory usage for each VM. Any single VM could have have used all the memory and CPU of entire host affecting other VMs on it. So we decided to limit each VMs CPU and memory resources. But even after setting limits, the VMs are exceeding those limits. Appreciate your help.

Thanks!

0 Kudos
DSTAVERT
Immortal
Immortal

DON'T set limits. Give each VM an appropriate amount of RAM and number of vCPU's. Put all the settings back to normal values. If you have less system RAM than you have given to all your VMs get more RAM. While ESX(i) can over allocate RAM it can only do so much.

-- David -- VMware Communities Moderator
0 Kudos
DSTAVERT
Immortal
Immortal

Moving to the vMotion & Resource Management forum.

-- David -- VMware Communities Moderator
0 Kudos
depping
Leadership
Leadership

A VM can neve consume more memory than it has been allocated. So if you allocated 1GB it will never consume more than 1GB so there is no need to limit it! Even in the case of CPU it is and probably will be limiting you more than you will and can benefit from it.

Duncan (VCDX)

Available now on Amazon: vSphere 4.1 HA and DRS technical deepdive

0 Kudos