Reduce Citrix Director Interactive Session Time to as little as 3 seconds

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.

For more logon time reduction tips see http://www.jgspiers.com/citrix-director-reduce-logon-times/

What is Interactive Session Time?

From https://www.citrix.com/blogs/2016/08/19/interactive-session-of-logon-duration-in-citrix-director-explained/

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, it instead runs some time after the profile has loaded.

What is faster than startup applications specified within the Run key? A log on Scheduled Task.

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.


15 Comments

  • Sommerers

    May 3, 2017

    Do you know if a GPO Scheduled task is faster than a WEM task? I assume it would be but figured I’d inquire.

    Reply
    • George Spiers

      May 3, 2017

      I’ll bet that a Scheduled Task is faster than WEM – give it a shot?

      Reply
      • Sommerers

        May 3, 2017

        I’m toying with this right now, but so far the results from WEM aren’t impressive. I still need to do an assignment order test to see if that makes any differences. I did also test with a GPO Scheduled Task but didn’t get as low of a result as you did, but I believe this is due to my configuration. If someone else is noticing the same you can go into the eventlog and under “Applications and Services\Microsoft\Windows\TaskScheduler\Operational” you can validate that the UPMEvent triggers in the first 3 seconds of logon. I did have a question about the GPO Schedule. By default the Priority is set to 7 for the task if we could somehow bump it to 4 would this improve the interactive Session more? I really don’t know what the metrics would looks like and if this would really help align the login time more. I was just looking up something and started wondering what would happen.

        Reply
        • George Spiers

          May 3, 2017

          The priority can be changed by editing the scheduled tasks XML file within SYSVOL. Setting a priority of 6 didn’t have a big effect on the logon times. Some times were lower and others higher.

          Also see http://www.jgspiers.com/citrix-director-reduce-logon-times/ for some more logon improvement tips. I used these to help get the times down to 3 seconds.

          Reply
  • Sommerers

    May 3, 2017

    I think there is a typo at “%LogonDomain%\LogonUser%” it looks like you are missing a “%”.

    Reply
    • George Spiers

      May 3, 2017

      Yes it is a typo, thanks. Corrected!

      Reply
  • pzario

    May 3, 2017

    when i set Scheduled task , interactive session increase to 2x time ?
    normal : 5 sec
    with ur option : 10-12 sec

    Reply
    • George Spiers

      May 3, 2017

      That is not normal. Do you have the Scheduled Task set to run at log on? To be honest, if you are already getting 5 second Interactive Session Time then you are OK.
      This will more help people whose current times are above the 20+ mark.

      Reply
  • James

    May 4, 2017

    awesome! bit of typo in the schedule task creation – need to specify the full path to the .exe 🙂

    “C:\Program Files\Citrix\Virtual Desktop Agent\upmEvent.exe”

    Reply
    • George Spiers

      May 4, 2017

      The Scheduled Task doesn’t require .exe to be filled in, atleast for me it didn’t. Did you have to specify it?

      Reply
      • James

        May 4, 2017

        I did in both the environments i put it into today – without the .exe i got a “not found” error in task scheduler – epic results though, this has been a nuisance for a long time so well played 🙂

        Reply
        • George Spiers

          May 4, 2017

          Thanks James.

          Reply
  • Kai Guettner

    May 4, 2017

    So does this actually reduce the login time, or just the representation of it in Director?

    Reply
  • ourgeisinger

    July 12, 2017

    Check the event log for the UPMID. Use the time as a starting point in Procmon to go back in time for the amount of time shown in Director for the interactive session.

    Reply

Leave a Reply