How to check performance of robots using Process Monitor

How to check performance of robots using Process Monitor?

Problem: Attended robots performs slower/faster than Unattended robots and we need to investigate what is causing the performance issue.

Prerequisites:  Understanding how Process Monitor from Sysinternals suite works

Step-by-step guide

Prerequisites for testing:

  1. Robot connected to Orchestrator, which can be changed to Attended/Unattended.
  2. Process monitor tool downloaded on the robot machine.
  3. Access to robot machine.
  4. All tests performed on same machine, same robot user, same workflows.

Step by step data collection for Unattended robot:

  • Startup Procmon scheduler
  1. Remote connect to the Unattended robot machine
  2. Access Task Scheduler tool from Start > Run > taskschd.msc (or by searching for task scheduler)
  3. Browse to Action > Create Task... or choose Create Task from right Actions Panel

  4. In the General tab specify a name for your task (ie: Process Monitor start) and optional a description.
    In the Security options section check on Run whether user is logged on or not option, to enable TaskScheduler to run unattended.
    Also the user should be the one that can remote connect to the robot machine and be able to execute attended jobs.
     
  5. From the Trigger tab, Click on New to define a new trigger for your Process Monitor job to start.
    There are several options including System Startup, Scheduled time or when event is populated in the event viewer.
    For the trigger to be active Enabled checkbox should be checked.
    ***Note: For this particular trigger a restart computer is mandatory in order to trigger it.

     
  6. On Action tab define a New action from the menu and select Start a program.
    Browse for the folder where Procmon.exe file were downloaded and add arguments "/accepteula /quiet /BackingFile C:\temp\log.pml" (without quotes)


    Note that  /BackingFile C:\temp\log.pml will write in that folder a new log each time overwriting the old file. This setting can be accessed from ProcMon main window too.

     
  7. On Conditions tab uncheck everything.

     
  8. Click Ok to save it and provide a password for the user if prompted.

 

  • Terminate ProcMon scheduler
  1. Once startup ProcMon is completed, another scheduler to terminate ProcMon gracefully process must be set up. This is mandatory and will ensure that the .pml file saved on disk is not corrupted and can be read.
     
  2. Use the same steps as for ProcMon start to create new task and check on Run whether user is logged on or not option
  3. Same as trigger for start, a trigger (or several triggers) must be set for terminate job.
    Two triggers are defined for this scenario as following

    1. First trigger is set as On an event → Basic type → Application log with Source UiPath and EventID 0 
      This trigger ensure that ProcMon terminates if there's an error in the workflow running, because those errors are caught in the Windows Applications logs as errors with EventID 0
    2. Second trigger is set as On disconnect from user session and used the user running unattended robot with Connection from remote computer option. This will ensure that if the user connects remotely to the robot machine a disconnect user occurs first, then user relogins to the machine.
      So this step will also trigger a terminate command for the ProcMon  

***Both triggers need to be enabled to ensure that on both success or failure for the workflow, the ProcMon will close correctly and save log file.

4. On Conditions tab uncheck everything like in previous step and click ok to save trigger. Provide a password for the user if prompted.

Actual performance comparison:

Once both Task Scheduler jobs for Startup and Terminate ProcMon are defined, restart the machine (or logoff and wait until the specified time when ProcMon will start) and launch the workflow when robot is available.

Refresh the Orchestrator job page until job is completed, then remote to the robot machine. A very LARGE .pml for the Unattended scenario test will be saved in the location indicated.

(***Note that this file can be very big in size and that is normal. Also its size is directly depended on the length of the workflow running, other services and programs running in the background of the robot machine)
 

From Orchestrator edit the robot and change its type to Attended.
Run the same workflow on the robot machine directly from robot tray and capture the job using Process Monitor like usual. Save the file with a different name to not overwrite the unattended log.
Open both .pml files from Attended and Unattended scenarios with ProcMon and use the Show Process Tree feature to locate UiPath Executor


 

Compare start time and end time for both scenarios and note that UNattended robots will always tend to perform a bit slower than attended ones, due to the way Windows OS operates with sessions.
 



Good practices:

  1. Work as fast as possible when running ProcMon and logging processes, this will lower the size of the log files.
  2. Tailor the Start and Terminate triggers for ProcMon as needed taken into consideration time schedules, events, logging etc.
  3. Name logs with appropriate names (ie: Unattended_ProcMon_31May.PML)
  4. Isolate which part of bigger automation is causing delays and rerun tests only on that particular xaml file if possible. (zoom into delays)