VMware vSphere

 View Only
Expand all | Collapse all

How can I determine how much RAM to allocate? (re: home server)

  • 1.  How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 02:00 PM

    I'm using ESXi 5 on a home server which is used to serve files, transcode video, and have a web server.

    The complicated part is that 90% of the time, everything is idle  except for the file server and download server (ie. when I'm copying files, watching a video  off a file server SMB/CIFS share, etc).

    My server has 16 GB of RAM and I've allocated my VMs like this:

    • 8 GB - ZFS (file server)
    • 4 GB - Download Server (Ubuntu) - used for downloading files (uses lots of resources for RAR extracting, parity checking, etc)
    • 4 GB - Media Server (Ubuntu) - used for transcoding (very, very rarely used but when used it requires lots of power/resources)
    • 2 GB - Web Server (Ubuntu) - (very, very rarely used)

    I've overcomitted by RAM by 2 GB but 95% of the time the Media Server  and Web Server are completely idle.  I'd like the ZFS server (and  Download Server) to use this idle RAM as needed.

    What's the best way for me to configure my ESXi host?

    There are also times when I'm experimenting with other VMs so I also  have a Database Server (Win 2k8, SQL Server) and ASP.NET Server (Win  2k8, IIS) but 90% of the time I'm using the above setup and I just want  to optimize it the best I can.



  • 2.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 02:43 PM

    I've overcomitted by RAM by 2 GB but 95% of the time the Media Server  and Web Server are completely idle.  I'd like the ZFS server (and  Download Server) to use this idle RAM as needed.

    What's the best way for me to configure my ESXi host?

    The host will figure it out - just allocate more ram to the ZFS server but don't reserve it.  If there is more memory available, the ZFS server can take it.  If not, the balloon driver will kick and take it back if the other guests need it.



  • 3.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 02:58 PM

    Thanks!

    What would happen if I really overcommit my memory by a lot?

    Example:

    8 GB - ZFS

    8 GB - Download Server (Ubuntu)

    8 GB - Media Server (Ubuntu)

    2 GB - Public Server

    That's 26 GB so it's overcomitted by 10 GB.

    How would that work?  Would there be any performance penalties?  (of course if all three servers started be utilized at the same time they would be competing for RAM, but as I mentioned typically everything is idle or only one or two servers are active at any given time)

    I'd like the Media Server and Download Server to use the RAM "on demand" or as-needed but when they aren't in use then the ZFS Server could use the extra resources...

    (Most of the time the Media Server will be idle though as I mentioned)



  • 4.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 03:35 PM

    Overcommitment like that is common and fine.

    If you aren't exceeding what the host can do from an actual usage perspective, then there will be no performance hit.  If you do exceed it, the performance hit will be significant.



  • 5.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 05:17 PM

    Thanks so much!

    Does that also work with Windows 7/2008 caching?  (ie. it will automatically fill all available memory that isn't in-use to cache/pre-load applications, etc)

    I'm also unsure how that would work with ZFS since it also uses all available RAM for file caching, etc.



  • 6.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 06:04 PM

    Windows Wont pre-zero, but it will use unallocated memory for caching.



  • 7.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 13, 2011 07:06 PM
    Right but I don't want it to use the unallocated memory.  I'd rather let my other VMs use the memory instead of Windows pre-caching stuff that I might not even need, etc.  I understand the benefit of this for desktop machines but in a virtual environment other VMs might need the memory that Windows is hogging, etc.


  • 8.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 14, 2011 10:34 PM

    If the host gets cramped for memory, it will take that 'caching' memory back from the VM (using the balloon driver).



  • 9.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 14, 2011 09:27 AM

    Lot depends on what kind of GOS you use and also the kind workload you  are going to run inside the GOS.If the GOS is the same in all VMs then  because of Transparent Page sharing you will be able to save a lot of  memory.What I would suggest you is that over-commit till the point  your  VM performance do not degrades and do not start using ballooning and  swapping. Identify the VM which is very critical and give that VM more RAM instead giving equal share of the RAM to all other VM.you can use esxtop to monitor the stats of swapping and  ballooning.



  • 10.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 14, 2011 06:22 PM

    General rule of thumb is to only allocate as much resources as the VM actually NEEDS... This applies to both vCPUs and vRAM... Linux is often very happy with less memory. I would try reducing the amounts where possible and see if you have alarms going off on the VM's. Check the Tasks & Events and Alarms tab on the VM's for at least a few days to a week. If you're good with less 95% of the time, and it's not crashing when higher, or the OS isn't complaining, then I'd leave it alone.

    IMO, you're better off allocating the correct amount, than over allocating resources to the VM's. It's easy enough to add more, on the fly even (depending on the OS), resources as needed/demanded.



  • 11.  RE: How can I determine how much RAM to allocate? (re: home server)

    Posted Oct 14, 2011 08:52 PM

    Hah, I generally give my Debian boxes 0.25-0.5GB/RAM unless they're going to be doing some leg work. You're more than fine on your allocations there (8GB of RAM on ZFS should get you covered with like a couple of terrabytes of deduped disk IIRC, 2GB/Ubuntu box will get you decent desktop performance, 4GB IMO is overkill being as I think you'll bury your CPU before anything else packing/unpacking).

    I'd do free -m and find out how many of those machines aren't just caching their disks todeath, which depending on your workload: can be a terrible waste.