• Insights

Monitoring RAM Cache Used w/ PowerShell

Clinton Gates

< 1 min read

All Insights

As we try to engineer the best available working environment for our end users, more and more clients have tried to store user cache in memory.  While this does provide the best performance, it also has it’s limitations discussed in this blog post by my colleague Jeff Silverman.  If you have the ability to store the user cache in memory it’s important to also monitor just how full that memory allotment is getting.  If it fills up, and Windows has no where to write user information, the system most likely end in a BSOD for the user.

Citrix provides a nice PowerShell command to query the RAM cache used via the MCLI PowerShell snap-in.  This snap-in (McliPSSnapIn.dll) comes standard with Provisioning Server Console install and is located in C:Program FilesCitrixProvisioning Services Console.  Before it can be added to PowerShell, the dll must be registered on any system wish to run the query from.

To register the dll on a 64-bit machine, run the following PowerShell command:

    • C:WINDOWSMicrosoft.NETFramework64v2.0.50727InstallUtil.exe ‘C:Program FilesCitrixProvisioning Services ConsoleMcliPSSnapIn.dll’

To add the snap-in to a PowerShell command prompt, run the following command:

    • Add-PSSnapin -Name McliPSSnapIn

Run the following command against a XenApp server to see how much RAM cache is used:

    • mcli-get deviceinfo -p devicename={servername} -f status

The second number returned in the status section is the percentage of the RAM Cache used.