The Interactive Session metric recorded by Citrix Director has always confused those trying to investigate why logon times are so high.
In this post I’ll explain how you can cut Interactive Session time by more than 60% immediately. You can reduce the time to as little as 3 seconds. This allows Citrix Director logon time reporting to become much more accurate.
If you are running VDA 7.14.1+ then you don’t need to do anything to upmEvent.exe as described in this post, however I still recommend you read the post as it is interesting to understand how Director calculates logon times. If you are running versions earlier than 7.14.1 then this post will fully apply to you.
For more logon time reduction tips see http://www.jgspiers.com/citrix-director-reduce-logon-times/
Changes to VDA 7.14.1+ – upmEvent.exe is now run as part of Winlogon:
Since this post was originally created in May 2017, Citrix have since in VDA 7.14.1 and above removed the upmEvent.exe run key and moved it to the Userinit string. It was only when James Kindon reported to me that he wasn’t seeing the run key on VDAs 7.14.1+ (thanks!) that I decided to investigate myself and realised the change.
This change results in upmEvent.exe running much quicker than previous versions because Citrix have allowed Winlogon to run the .exe, moving upmEvent.exe away from the Run registry key. This is an out of the box enhancement.
What is Interactive Session Time?
It is the time taken to handoff keyboard and mouse control to the user after the profile of the user is loaded for a session.
Event ID 2 is initially logged on the VDA shortly after a desktop/application icon is clicked within Receiver client or Receiver for Web. This event triggers the Interactive Session timer which ends once Event 1000 is logged to indicate that the session is ready for use. Event ID 1000 is logged by the Citrix Profile Management service.
So whilst Director records logon times, it is important to understand that this is the time taken from clicking to launch a resource until the machine is actually usable even though the actual logon may have completed some time before that. This produces innacurate results in Director for true logon times.
The Interactive Session time is calculated once Event ID 1000 is logged on the VDA. The faster the UPM Event User Message runs the quicker Event 1000 is logged and the calculation is complete.
So ideally we want upmEvent.exe (or UpmUserMsg.exe for VDAs prior to v7.7) to run once we see that desktop wallpaper as that is when the logon is complete. By default on VDAs before 7.14.1, it instead runs some time after the profile has loaded. In VDA 7.14.1 and above, upmEvent.exe runs at user logon, even before the desktop wallpaper has loaded. This results in more accurate logon times out of the box.
For VDAs earlier than 7.14.1, what is faster than startup applications specified within the Run key? A log on Scheduled Task or specifying upmEvent.exe in the Userinit registry string..
On VDAs earlier than 7.14.1, open your gold image or Citrix App Layering Platform Layer (the Platform Layer should contain your VDA software). Launch RegEdit and navigate to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Delete the Citrix UPM UserMsg string. Finalise the image.
Now using Group Policy, create a new GPO which applies to all users logging on to the VDA.
Within the GPO expand User Configuration -> Preferences -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7).
On the General tab specify a name. Keep the task running under %LogonDomain%\%LogonUser%. Set Configure for to Windows 7 or the highest available OS.
On the Triggers tab click New.
For Begin the task choose At log on and for Any user. Click OK.
On the Actions tab click New.
Under Action select Start a program. Under Program/script enter “C:\Program Files\Citrix\Virtual Desktop Agent\upmEvent.exe” and beside Add arguments (optional) enter wait. Click OK.
Click OK to finish creating the Scheduled Task. When users log on to a VDA the UPMEvent.exe program launches via Scheduled Task immediately when the desktop shell has loaded.
With UPMevent.exe being started now by the Scheduled Task the average logon time has dropped to 13 seconds. Notice the Interactive Session times are all at 3 seconds, more than 50 seconds lower than a default XenDesktop 7.13 installation I ran my testing on. These results are on a non-persistent VDA which is rebooted between each logon.
Director is logging much truer logon times and our future reports will be much more accurate.
Note: In VDA versions before 7.7, upmEvent.exe was called upmUserMsg.exe.
Alternatively, instead of using a Scheduled Task for VDA 7.13 and below, you could instead move upmEvent.exe to the Userinit string. You can perform this change directly in an App Layer or gold image if using PVS/MCS. This is exactly what Citrix are doing in 7.14.1 and above VDA releases. This string is stored under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
Difference in logon times between VDA 7.13 and VDA 7.16 out-of-box installs:
I’ve done some testing on the difference between Director logon duration recordings from a VDA 7.13 machine which has upmEvent.exe specified under the Run registry key and VDA 7.16 which has upmEvent.exe specified under the Userinit string. These are simple tests, no profile management or such is used.
Testing logons with a VDA 7.13 machine:
Citrix Director recorded times:
- Logon 1: 32.534sec
- Logon 2: 31.447sec
- Logon 3: 31.8sec
Stopwatch recorded times:
- Logon 1: 18.7sec
- Logon 2: 17.43sec
- Logon 3: 17.63sec
Outcome: Director is reporting around 13-15 seconds longer logon times than what I am recording when timing resource launch to reaching the desktop wallpaper.
Testing logons with a VDA 7.16 machine:
Citrix Director recorded times:
- Logon 1: 21.57sec
- Logon 2: 20.466sec
- Logon 3: 21.713sec
Stopwatch recorded times:
- Logon 1: 25.47sec
- Logon 2: 25.26sec
- Logon 3: 26.22sec
Outcome: Director is reporting around 4-5 seconds shorter logon times than what I am recording when timing resource launch to reaching the desktop wallpaper.
As you can see, with upmEvent.exe running as part of Winlogon, Director is recording a logon time shorter than what the stopwatch is. The stopwatch time is the time taken to click on the desktop resource in Receiver for Web to first seeing the desktop wallpaper. This means that Director on average is recording a logon time 4-5 seconds before the user actually sees a desktop wallpaper.