How to check performance of robots using Process Monitor

How to check performance of robots using Process Monitor?

Problem: Attended robots perform 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 the same machine, same robot user, and 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

    1.jpg
  4. In the General tab specify a name for your task (ie: Process Monitor start) and an optional 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 remotely connect to the robot machine and 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.
    2.jpg
  6. On the 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)
    3.jpg

    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.
    4.jpg
  7. On the Conditions tab uncheck everything.
    5.jpg
  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 follows

    1. The first trigger is set as On an event → Basic type → Application log with Source UiPath and EventID 0
      This trigger ensures 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. The 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 the Conditions tab uncheck everything like in the 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 log off and wait until the specified time when ProcMon will start) and launch the workflow when the 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 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 the 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


6.jpg

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 taking 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)

2 Likes