Thursday, 15 March 2012

Improving AppSense performance by excluding Citrix hooks

In a lot of situations, AppSense software is installed on Citrix systems. That's not to say it isn't used frequently on Remote Desktop Services or standard PCs - in my experience, though, it has mostly cropped up on either XenApp or XenDesktop implementations.

Sometimes the AppSense software I come into contact with appears to be less stable than other deployments. You can occasionally see a range of performance and stability issues, crashes and hangs or other unpredicted behaviour. In these situations, users often fail to see the benefits of the software because their overall user experience has been affected, and this isn't what you want to happen.

Fortunately, you can track a lot of this instability down to various Citrix hooks. The main culprits are generally the Citrix Multi-Monitor hook (mmhook.dll) and the EdgeSight monitoring components. EdgeSight, whilst a great tool, by its very nature has to interact very closely with a lot of the running system processes. If you are experiencing any instability - or even if you aren't, but just want to optimize your Citrix/AppSense deployment - then the following exclusions should make a lot of difference to the performance of your system.

Exclude the main Citrix hooks by using this process (dependent on Citrix and/or OS version, some of these Registry keys may not be present)


Keys (add the value to all of the keys available)

HKLM\SOFTWARE\Citrix\CtxHook
HKLM\SOFTWARE\Wow6432Node\Citrix\CtxHook64
HKLM\SOFTWARE\Wow6432Node\Citrix\CtxHook

Value : ExcludedImageNames
Type : REG_SZ
Data : AMAgent.exe,Cca.exe,WatchdogAgent.exe,WatchdogAgent64.exe,EMAgent.exe,
EMAgentAssist.exe,EMNotify.exe,EmCoreService.exe,EmExit.exe,EmLoggedOnUser.exe,
EmSystem.exe,EmUser.exe,EmUserLogoff.exe,PmAgent.exe,PmAgentAssist.exe

The following list of processes also needs adding to another Registry key to exclude them from EdgeSight monitoring. Note that the EdgeSight value data (shown below) is delimited by semicolon rather than commas.


Key

HKLM\SYSTEM\CurrentControlSet\Services\rskcore

Value : UviProcessExcludes
Type : REG_SZ
Data : AMAgent.exe;Cca.exe;WatchdogAgent.exe;WatchdogAgent64.exe;EMAgent.exe;
EMAgentAssist.exe;EMNotify.exe;EmCoreService.exe;EmExit.exe;EmLoggedOnUser.exe;
EmSystem.exe;EmUser.exe;EmUserLogoff.exe;PmAgent.exe;PmAgentAssist.exe


A caveat to the EdgeSight exclusions is that by installing Hotfix ES540XA6AgentWX64001 for EdgeSight for XenApp Agents, Version 5.4.7.1, the above UVIProcessExcludes value will be deprecated on the Server. Any value data within UVIProcessExcludes will be migrated to the new UviProcessIsExcluded location (please see Citrix article http://support.citrix.com/article/CTX131261 for more information).

So if the above hotfix is installed, you will need to add the process list to the following Registry key instead:-

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\rskcore
Name: UviProcessList
Type: REG_SZ


And set the following Registry value to a DWORD value of 1 to enable it:-

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\rskcore

Name: UviProcessIsExcluded
Type: REG_DWORD



I find it best to deploy these Registry values either by Group Policy Preferences (shown in the examples above), an AppSense Environment Manager Computer Startup action (if using persistent disks), or by inserting it into your base server image.

A quick note - I originally gleaned these settings from a document provided to me by a Citrix administrator I worked with, however it would seem that the settings and flow of the document they shared with me were shoehorned from an AppSense technote. Apologies if there is any unintentional reproduction here.

9 comments:

  1. Does this apply to xendesktop 5.6? Xenapp 6.5?

    What kind of instability issues have you seen without the modifications?

    Thanks.

    RR

    ReplyDelete
  2. I've seen this mainly on my XenApp implementations up to v6.5, less so on XenDesktop. The instability issues are slow logons, slow app launches, poor performance on published desktops, etc.

    This is one of the stability fixes I generally use alongside the usual gotchas for EdgeSight, AV, etc.

    Cheers,



    JR

    ReplyDelete
  3. Edgesight and appsense are a major pain, please don't inflict this malware on your users anymore. Humorously these "monitoring" tools are the major source of PC performance problems at work.

    ReplyDelete
  4. Well I've heard a rumour that EdgeSight may be no more soon, so that's good news for all concerned :-)

    ReplyDelete
  5. According to http://support.citrix.com/article/CTX134770 , which says a entry in the UviProcessList must not exceed 14 characters the list should look like

    AMAgent.exe;Cca.exe;WatchdogAgent.;WatchdogAgent6;EMAgent.exe;EMAgentAssist.;EMNotify.exe;EmCoreService.;EmExit.exe;EmLoggedOnUser;EmSystem.exe;EmUser.exe;EmUserLogoff.e;PmAgent.exe;PmAgentAssist.;rotatelogs.exe

    ReplyDelete
    Replies
    1. Thanks for pointing me to that article! I will have a look through it later and update the post as appropriate, cheers.

      Delete
  6. It is actually the Process name that is limited to 14 characters and not the entire list

    Except from the article mentioned above
    - Program names whose length is <=14 characters are entered into the list as is.
    - Program names whose length is >14 characters are entered with only the first 14 characters

    Cheers, Matthew

    ReplyDelete
    Replies
    1. This 14 charactors name limit is no longer needed for EdgeSight exclusion list. We confirmed that we can use program names longer than 14 chars on XenApp 6.5 HRP2 and ES 5.4 agent.

      Delete
  7. We are running XenApp 6.5 with HRP01, does these changes still need to be applied.

    Thanks,
    MTB

    ReplyDelete