Machine Creation Services Storage RAM and Disk Cache

Citrix Machine Creation Services as of XenApp/XenDesktop 7.9 provides the ability to write to memory with overflow to disk just like what is available with PVS using RAM w/ overflow to HDD. This greatly decreases write I/O so you don’t have to rely as much on the underlying storage or worry about hitting a storage bottlenecks as you scale the desktop environment.

Previously with MCS, temporary writes went to the delta/differencing disk attached to the VM. You now have the option of using temporary memory (RAM) to handle the caching of writes and a temporary disk in the event the RAM cache becomes full. When overflowing writes to a disk keep in mind that you don’t want this to be the point of a bottleneck so size the environment properly and place temporary disks on storage that won’t pose a big degradation in performance. The more RAM you assign to the memory cache the less chance writes will ever reach disk. You could reduce IOPS by as much as 95% depending on how much RAM you can assign to the cache!

Temporary memory 256MB for VDI (desktop) and 2GB for Session Host (server) machines is recommended, which falls in line with what is recommended when using PVS RAM cache. If your VDI machines are 32-bit, 256MB is probably optimal. This is because the OS on 32-bit is limited to 4GB RAM maximum with 2GB assigned to kernel-mode for things like handling device driver code, kernel structures and so on that are either on paged or non-paged memory pools. When configuring MCSIO RAM on these VMs, the memory is shared with the non-paged pool. Given that MCSIO RAM can grow up to 50% larger than what you specify/allocate, you need to ensure the non-paged pool will always have enough memory or risk the machine crashing.

The temporary disk size is recommended to equal the free disk space of the VM plus the page file size. I normally set a 20GB cache size and get away with it but it all depends on your own environment.

With your Citrix Studio console open, running a XenApp or XenDesktop 7.9 farm, create a new Machine Catalog provisioned by MCS. Existing standard MCS catalogs cannot be converted to MCS using cache as an MCSIO specific driver is installed to the VMs whilst being provisioned. You have the following options during the MCS Machine Catalog creation wizard:

Memory allocated to cache (MB) – Provide a value in MB for how much RAM you want to assign to the cache. You have the option to use only the memory cache but be aware if the memory cache runs dry your VMs will become unstable and likely freeze or blue screen. For this reason it is recommended to deploy a temporary disk cache as a backup just in case.

Disk cache size (GB) – Provide a value in GB for how much disk space you want to dedicate to the disk cache. You can choose to create only a disk cache and this means VMs will perform like they always have done producing the same IOPS as they would when provisioned without any cache. The good thing about using a disk cache is that you can separate writes on to different storage away from the base image and differencing disk. It is always recommended to create a disk cache when using RAM cache just to be safe in the event that the RAM cache runs out of free space.

Note that you also have the option to not configure any cache so MCS machines will be created and operate as they always have done.

1-minClick Yes. Complete the MCS Machine Catalog creation wizard. You will now have machines optimized for writes.2-min

So using a simple file copy operation you can see the difference between a 2.6GB file copied to an MCS machine using cache (1GB) vs. one without cache. Reaching a max of 110 write IOPS per second on a 15K spindle.

What about general daily tasks such as internet browsing and file browsing? You can see results below comparing normal operations on an MCS provisioned machine using cache vs. one without. There is no direct hit on IOPS when the cache is in use!3-min

Using Performance Monitor on the Windows VDA you have a number of different counters that you can use to track performance and usage of the MCS cache. One particular useful counter is Cache memory used. This counter shows how much of the cache memory is in use. 4-minA simple test of copying a 710MB file to the VDA increased the Cached Used performance counter to accurately report what was now held in cache. Also note that 0 write IOPS were produced during the file copy. 5-min

This is a great improvement for MCS provisioned machines and now puts MCS right up there beside PVS when it comes to IOPS performance.

Additional points:

  • MCSIO works on Desktop/Server non-persistent and Session Host machines. Citrix Personal vDisks do not work with MCSIO ruling out persistent desktops.
  • The more RAM you assign to a cache the less IOPS storage will ever have to deal with.
  • You can not migrate existing MCS provisioned catalogs to MCSIO, you must recreate them.
  • In the event that temporary memory space runs out, the temporary disk storage is used. Most recently used blocks of data are kept in memory for performance and least used are flushed to disk quite like how PVS RAM caching works with overflow to HDD.
  • MCSIO can limit the amount of memory it uses in the event the VM becomes overloaded – the non-paged pool memory consumption on a machine is monitored and if it reaches 70% of available memory action is taken to suppress MCSIO memory usage annd instead write to disk until the non-paged pool memory consumption drops.
  • Disk cache and memory cache size cannot be changed once the Machine Catalog has been created.

18 Comments

  • Michael McAlpine

    October 26, 2016

    Do you have any rules for ram/disk allocation to MCS temporary data cache? I am considering flipping this on when we migrate from Server 2008r2 to Server 2016 and the disk space = cache space recommendation from Citrix seemed completely arbitrary.

    Reply
  • George Spiers

    October 26, 2016

    I would absolutely consider using RAM/disk cache with MCS when you migrate. I normally assign around 2GB RAM to Server VDAs. The more RAM you can safely assign to machines the less chance IOPS will ever have to fall back on to disk. That being said you don’t necessarily want to over subscribe machines with RAM for the sake of it so you should consider some testing with users on a box and make use of the MCS performance counters to track cache usage. Things you need to factor in are how many users will be connected to one Server VDA, what applications will be used, do the applications cache much data, how often servers are set to restart etc.

    Reply
    • Michael McAlpine

      October 27, 2016

      When we built our 7.x farm we basically guessed at resources and we guessed way too high so I have quite a bit of free memory on my hosts. Our our 08r2 machines currently support 19-20 users 4 vcpu’s 16 GB of memory. I’m really not sure how I am going to build the Server 2016 RDSH machines because I am not aware of any recommendations for builds. I don’t see more than 650 concurrent connectsions, so I am planning on trying to decrease the number of RDSH servers I have from 30 to 20 by beefing up my 2016 VM’s. I expect to see 30-35 users per machine.

      Have you seen any guides or do you have one in the works for Server 2016 and XenApp desktop/application hosts?

      Reply
  • George Spiers

    October 27, 2016

    I haven’t got round to working with Server 2016 yet but cannot imagine deployment best practices will be too different from 2012 R2. There’s a whole blog post on optimising 2012 R2 at https://www.citrix.com/blogs/2014/02/06/windows-8-and-server-2012-optimization-guide/. Any recommended optimisation should be evaluated individually to determine if implementing will have a positive outcome. Server 2016 is supported right now with XenApp 7.11.

    Reply
    • Michael McAlpine

      October 28, 2016

      Thanks, I’ve done testing and I have a catalog with the Server 2016 VDA. Excluding OS optimizations, user validation, and KMS licensing, Server 2016 is working well in my 7.11 environment… so kudos to Citrix for day one support. I expect to roll over to Server 2016 in Jan/Feb depending on user testing and acceptance.

      Reply
      • George Spiers

        October 28, 2016

        Sounds good! Good luck 😉

        Reply
  • Cenk

    January 19, 2017

    Hi, have you had to change the swap file within the OS at all ? I am assigning 16gb RAM, 4gb cache and 100gb (size of VM) to disk cache. Any suggestions would be appreciated. OS is Server 2012R2, Published Apps on XA 7.12.

    Reply
    • George Spiers

      January 19, 2017

      I remove system managed pagefile’s and have them manually configured with a min/max size. The max size equaling the amount of RAM on the VM. If you don’t care so much about performing full memory dumps you could decrease the size of the page file. I’d recommend not allowing the pagefile to be system managed though.

      Reply
  • Oykleppe

    February 15, 2017

    Hi
    On a setup with only local SSD storage, will the Memory cache make any noticeable impact for the users?
    If i used shared storage or spinning disks maybe. But with only local SSD it wouldn’t make much difference anyway?

    Reply
    • George Spiers

      February 15, 2017

      Local SSD storage is great. I wouldn’t use RAM cache unless the virtual machines were doing major IOPS heavy jobs or I wanted more density. If you have workers who run heavy IOPS intensive workloads or you are looking to maximise the VDA density per SSD, then RAM cache can certainly help. It all depends on your requirements

      Reply
  • Pavan

    July 17, 2017

    Hello George,
    Do we need to add a additional hard drive to the master image for the machine-creation-services-storage-ram-disk-cache catalog? Or just add one and the process will create for itsel? Thanks, Pavan

    Reply
    • George Spiers

      July 17, 2017

      Hi Pavan, the Gold VM does not have to have an additional Hard Drive. When you run through creating a Machine Catalog using MCS, there is a tick-box option to include an HDD in the build which will act as your overflow disk.

      Reply
  • Matheen

    September 28, 2017

    Hi George,
    Thanks for the article. If I use MCS full clone dedicated desktop, Would I be able to use MCS IO? I have dedicated VDIs which are running slow. My intention is to create a master image, convert them to Full clone dedicated VDI and use MCS IO. Not sure if this can be done.

    Reply
    • George Spiers

      September 28, 2017

      Yes certainly, it can be done on XenDesktop 7.9 and above releases.

      Reply
  • Richard Hughes-Chen

    October 12, 2017

    Does MCS support a 2nd disk as part of the Master image? There is a application which requires a drive other than C: to be available. Not talking about a cache disk.

    Reply
    • George Spiers

      October 12, 2017

      Nope – you would have to create those disks manually yourself once the VMs have been created.

      Reply
  • Shaun

    November 25, 2017

    I’ve enabled MCS RAM cache. What is total memory mean when creating a MCS catalog? How much memory would each of your VDA’s report on having in vSphere? I’ve set a total of 14GB and 4GB of RAM cache, but when looking on vSphere it only reports on having 10GB of RAM. Is this correct?

    Reply
    • George Spiers

      November 25, 2017

      No not heard of that before. If you specify total ram as 14GB the VM should receive 14GB.

      Reply

Leave a Reply