Is it possible to schedule an App Pool recycle on a specific time only during work days?
Thanks in advance!
In case you can't configure the desired schedule using IIS directly, you could create a scheduled task that invokes
c:\Windows\system32\inetsrv\appcmd.exe recycle apppool "NameOfTheAppPool"
at the required times.
If you are using IIS 7, PeriodicRestart
is the key. Add the following into your ApplicationHost.config
file:
<add name="YourApplicationPool">
<recycling logEventOnRecycle="Schedule">
<periodicRestart>
<schedule>
<clear />
<add value="12:00:00" />
</schedule>
</periodicRestart>
</recycling>
<processModel identityType="NetworkService" shutdownTimeLimit="00:00:30" startupTimeLimit="00:00:30" />
</add>
It will recycle your Application Pool
at 12 o'clock each day.
If you are using IIS7, you could setup a Scheduled Task
, for the work days, running the following command:
appcmd.exe recycle apppool "YourApplicationPool"
If you are using IIS6, I'd follow the guide here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With