+ Post New Thread
Results 1 to 6 of 6
Thin Client and Virtual Machines Thread, Linux VM generates large swap file when there is still memory available ? in Technical; ...
  1. #1

    Join Date
    May 2009
    Location
    Sydney
    Posts
    282
    Thank Post
    322
    Thanked 3 Times in 3 Posts
    Rep Power
    12

    Linux VM generates large swap file when there is still memory available ?

    Hi All,

    My ESXi Specs:

    Dual QuadCore
    Xeon @ 2.33 GHz (2 x 4 Core)
    32 GB DDR2 RAM

    Running about 22 VMs

    Iíve got a strange problem, How come my ESXi got so large swap
    file size ~ approx. 3.5 GB while the amount of total RAM is still not
    100 % used.

    I've assigned the following specs as in the screenshot (4 vCPU for better performance).

    Can anyone explains why this VM still using swap file?

    FYI: The VMware tools is not installed in this VM.

    When I look at the Guest memory % usage it doesn't make sense to me that this host running slow due to the Swap file created (ESXi swap as well as the Internal VM swap file).

    The VM that i highlighted is the slowest with big swap file created. --> See the screenshot attached.

    Thanks,

    Albert
    Attached Images Attached Images

  2. #2
    apaton's Avatar
    Join Date
    Jun 2009
    Location
    Kings Norton
    Posts
    283
    Thank Post
    54
    Thanked 106 Times in 87 Posts
    Rep Power
    36
    I would recommeded the following.

    Install VMtools to enable the balloon memory driver (screen grabs says not installed)
    Add a memory reservation for the VM, try 50% to start with.

    Another note, espiacllay as you have 4 vCPU's VM's, enable hyper-threading if available.

    Andy

  3. Thanks to apaton from:

    albertwt (3rd March 2010)

  4. #3

    Join Date
    May 2009
    Location
    Sydney
    Posts
    282
    Thank Post
    322
    Thanked 3 Times in 3 Posts
    Rep Power
    12

    Question

    Quote Originally Posted by apaton View Post
    I would recommeded the following.

    Install VMtools to enable the balloon memory driver (screen grabs says not installed)
    Add a memory reservation for the VM, try 50% to start with.

    Another note, espiacllay as you have 4 vCPU's VM's, enable hyper-threading if available.

    Andy
    Hi Andy,

    thanks for the reply.

    Does this means that by not having VMware tools installed the memory over allocation is killing the host by writing into the ESXi swap file ?

  5. #4
    apaton's Avatar
    Join Date
    Jun 2009
    Location
    Kings Norton
    Posts
    283
    Thank Post
    54
    Thanked 106 Times in 87 Posts
    Rep Power
    36
    Quote Originally Posted by albertwt View Post
    Hi Andy,
    Does this means that by not having VMware tools installed the memory over allocation is killing the host by writing into the ESXi swap file ?
    VMware tools provides a memory balloon driver, which can be called to force the VM to page internally when ESX host is short of memory (use VM's own internal swap/page mechanism).

    ESX only writes to swap file as last resort. Make sure your machine does need 4vCPU's and 8Gb memory, reduce now and add later when/if needed.


    Andy

  6. Thanks to apaton from:

    albertwt (9th March 2010)

  7. #5


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,491
    Thank Post
    868
    Thanked 855 Times in 675 Posts
    Rep Power
    197
    I have a heavily loaded desktop box that was suffering similar issues - in that i'd open my apps, run my VMs, and I would not need a lot more RAM after that, but linux appeared to be hoarding some This was resulting in a lot of swapping, and my disk aint so fast. So I tuned "swappiness" down from its normal value (60) to 30. This seemed to limit the growth of swap, at the expense of buffering files from disk. Seems to work well. 17 days later I will have to reboot to claim some of the ram firefox leaks back though

    As root:
    Code:
    echo 30 >/proc/sys/vm/swappiness

  8. Thanks to tom_newton from:

    albertwt (9th March 2010)

  9. #6

    Join Date
    May 2009
    Location
    Sydney
    Posts
    282
    Thank Post
    322
    Thanked 3 Times in 3 Posts
    Rep Power
    12
    Quote Originally Posted by tom_newton View Post
    I have a heavily loaded desktop box that was suffering similar issues - in that i'd open my apps, run my VMs, and I would not need a lot more RAM after that, but linux appeared to be hoarding some This was resulting in a lot of swapping, and my disk aint so fast. So I tuned "swappiness" down from its normal value (60) to 30. This seemed to limit the growth of swap, at the expense of buffering files from disk. Seems to work well. 17 days later I will have to reboot to claim some of the ram firefox leaks back though

    As root:
    Code:
    echo 30 >/proc/sys/vm/swappiness
    Thanks Tom, it's good to know that you can also provide a twaek for the VM :-)



SHARE:
+ Post New Thread

Similar Threads

  1. Large Memory Sticks
    By Michael in forum Hardware
    Replies: 16
    Last Post: 3rd December 2009, 01:56 PM
  2. Swap file size
    By paulgarratt83 in forum Thin Client and Virtual Machines
    Replies: 1
    Last Post: 31st July 2009, 04:14 PM
  3. Replies: 7
    Last Post: 1st November 2007, 02:45 PM
  4. Patch city and large mdf file
    By GrumbleDook in forum MIS Systems
    Replies: 10
    Last Post: 4th October 2007, 11:20 PM
  5. large File Transfer
    By SimpleSi in forum Windows
    Replies: 20
    Last Post: 26th March 2007, 07:24 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •