VMware Cloud Community
Sharantyr
Contributor
Contributor
Jump to solution

ESXi abnormal Swapping ?

Hi,

I m lost about ESXi memory mangment, why is my host swapping????!

Here's the stats :

Host :

Total host memory 4GB

Memory usage 2.93GB (as seen in vi client summary tab)

Memory used by vmkernel 335MB (shown in performance tab of ESXi host)

Memory Swap used : 150MB (shown in performance tab of ESXi host)

_VM1 : _

512MB (total memory)

86MB (memory overhead)

456MB (host memory usage)

163MB (guest memory usage)

VM2 :

764MB (total memory)

104MB (memory overhead)

583MB (host memory usage)

244MB (guest memory usage)

VM3:

512MB (total memory)

102MB (memory overhead)

357MB (host memory usage)

122MB (guest memory usage)

VM4:

1024MB (total memory)

140MB (memory overhead)

912MB (host memory usage)

327MB (guest memory usage)

So, let's say all VM use all their memory + their overhead :

512867641045121021024+140= 3244

+ memory used by vmkernel

3244 + 335 = 3579MB

So I'm not on the 4GB, WHY the host SWAP 150MB ???

Why because 2.93GB of memory is used (as displayed on host overview, so 1GB free) then I have memory SWAP ! ?

Help thanks!!

0 Kudos
1 Solution

Accepted Solutions
DSTAVERT
Immortal
Immortal
Jump to solution

I just picked one of my servers. With 24GB ram and less than 8GB in use there is 300MB swap.

-- David -- VMware Communities Moderator

View solution in original post

0 Kudos
16 Replies
DSTAVERT
Immortal
Immortal
Jump to solution

Remember that each VM also creates and uses virtual memory (swap space). You may provide a guest wih 512 MB ram but the guest os will create swap space and can over commit memory.

Are you experiencing problems?

-- David -- VMware Communities Moderator
0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

The problem, as (maybe badly) described above, is that all my VMs would fit into my physical RAM but still, ESXi SWAP (all VM have 0 swap, I only see SWAP in the ESXi host performance page)

I counted the max RAM useable by VM + the reserved memory for managment of each VM + vmkkernel memory, its still inferior to my physical RAM, why SWAP ??

Sorry for my bad english Smiley Sad

0 Kudos
Josh26
Virtuoso
Virtuoso
Jump to solution

Windows server will do the same thing on physical hardware - no matter how much memory you have, it will swap out.

0 Kudos
calvinso
Contributor
Contributor
Jump to solution

If you familiar with linux, actually you can config swapping if kernel is 2.6

http://unixfoo.blogspot.com/2007/11/linux-performance-tuning.html

0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

Hi,

I have ESXi not ESX, so no service console to configure swap, or I'm missing something?

@[~658864] , So ESXi is acting like windows and stupidly swapping ? I can't believe this! Also The host wasn't doing this since 2 month, it started doing it since I added 256MB memory on a specific VM.

But I'm not overcommiting at all my memory ressources!

0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

bump :smileycool:

0 Kudos
RParker
Immortal
Immortal
Jump to solution

So ESXi is acting like windows and stupidly swapping ?

OK, first its not 'stupid' there is a reason for swap. In Windows it's by design. DLL's swap because the way RAM works, you don't to fill up service RAM with DLL library info, maybe it's the same thing in Linux, I don't know. But my only question is, it is causing a performance issue? If the answer is NO don't worry about what you SEE. It's not making an impact. If your ESX works, nothing is wrong, then what's the issue?

If you see swap and don't understand why, that's ok. ESX wasn't designed for your understanding it was designed to manage VM's. If its doing it's job, then no need to worry about something you can't control.

RParker
Immortal
Immortal
Jump to solution

I m lost about ESXi memory mangment, why is my host swapping????!

According to that article (keep in mind that ESX is NOT Linux, but it does use some similar structure) Linux has ACTIVE paging and PASSIVE paging, and sometimes it may swap VIRTUAL memory pages. Since the ESX version YOU are running is 32-bit this may be in all likelihood a 32-bit limitation, that MAYBE not all the Virtual paging memory (which is vastly different from RAM) has enough space, and therefore a page of part or all of that area was needed. If there WAS a page, it may have simply left remnants of that page and didn't purge the swap file. But it still doesn't mean ESX is having a problem, this may be doing it ALL the time, and it's either by design or a architectural flaw (more likely) with 32-bit chipset.s.

0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

Ok but remmember that I'm running ESX>i< and not ESX, you still think the same way?

It's just pretty weird how it's acting. Swapping is not a normal behavior <- reports my monitoring tool for ESXi because it send alerts when swap > 50MB

Also, when I'm reading my vmware curses, swapping is supposed to be the last resort when the ESXi is running out of memory, ballooning should happen before, but I don't have any ballooning.

So it confirm that it's not the VM fault but ESXi fault? But why swap since it's ESXi very light env ?

I really don't get it

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

ARE YOU HAVING PROBLEMS??? Swap is normal!

-- David -- VMware Communities Moderator
calvinso
Contributor
Contributor
Jump to solution

We should teach him, to monitor the performance, he should not focus on it is using swapping or not, he should focus on the page fault rate. Wahahahaha.

If page fault rate is high, that means not enough memory for current operation which lead to a lot of swapping occurs. If it is low, it is so normal.

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

I just picked one of my servers. With 24GB ram and less than 8GB in use there is 300MB swap.

-- David -- VMware Communities Moderator
0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

Ok, thanks DSTAVERT for the input, so this is a normal behavior. It was just weird that it happens not often at all and sudently disappear with no reason.

@[~359578] you have some complex of inferiority problems ? o_O

0 Kudos
calvinso
Contributor
Contributor
Jump to solution

for answering your complex inferiority questions. XD

0 Kudos
Sharantyr
Contributor
Contributor
Jump to solution

FYI,

The swap is gone when restarting agents (/sbin/services.sh restart) so it's most likely an ESXi bug.

Cheers

0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

And over time it will be back. It's normal.

-- David -- VMware Communities Moderator
0 Kudos