How to schedule regular recycles of the Orchestrator App pool to improve performance and minimize downtime?
Issue Description: Unexpected downtime or performance issues may be experienced with the Orchestrator application due to automatic recycling occurring when certain conditions are met, such as memory usage or a specified number of requests. These performance issues can impact business processes and the overall user experience.
Resolution: To improve performance and minimize downtime, it is recommended to schedule regular Orchestrator application pool recycles during periods of low usage or maintenance windows.
By following these steps, manage the health of the Orchestrator proactively and minimize potential issues related to memory leaks, resource exhaustion, or other problems:
- Identify periods of low usage or maintenance windows: Analyze your Orchestrator usage patterns and find times when the application is least likely to be actively used by your staff. This could be during non-business hours, weekends, or other periods specific to your organization's workflow.
- Set up a schedule for recycling the application pool using either the IIS Manager or PowerShell scripting:
- a. Using IIS Manager:
- Open the Internet Information Services (IIS) Manager on your Orchestrator server.
- Navigate to the server's hostname, expand "Sites", and select your Orchestrator website
- In the right pane, click on "Application Pools"
- Right-click on the Orchestrator Application Pool (usually named UiPathOrchestrator) and choose "Recycling" from the context menu
- In the "Edit Application Pool Recycling Settings" window, deselect any current automatic recycling settings (e.g., regular time intervals or specific memory limits)
- Check the box for "Specific time(s)" and enter the desired time for the recycling action
- Click "OK" to save the settings.
- b. Using PowerShell scripting:
- Create a new PowerShell script file (e.g., AppPoolRecycle.ps1) with the following content:
$AppPoolName = "UiPath Orchestrator"
$RecyclingTime = "02:00:00"
$appCmd = "$env:SystemRoot\system32\inetsrv\appcmd.exe"
$configSection = "/section:system.applicationHost/applicationPools"
$scheduleValue = "/+[name='$AppPoolName'].recycling.periodicRestart.schedule.[value='$RecyclingTime']"
& $appCmd set config $configSection $scheduleValue /commit:apphost
- Ensure that the desired recycling time is set in the $RecyclingTime variable.
- Run the script with administrator privileges on the Orchestrator server to apply the changes.
Now, monitor the Orchestrator's performance and adjust the recycling frequency as needed, based on the specific usage patterns and requirements.
By implementing these steps, it is possible to proactively manage the health of the Orchestrator and minimize potential issues related to memory leaks, resource exhaustion, or other problems that may occur over time.