Throttling CPU Usage In IIS
For Dedicated Server owners that are using their server to host multiple domains, there’s a very useful feature that is native to the IIS web server environment that allows you to restrict the CPU usage for an application pool. This can allow your server to run more smoothly and help to keep your server’s CPU usage spiking to an unhealthy level due to an influx of traffic.
To implement CPU throttling for a particular application pool, please follow the steps below:
-
Access your Server via RDP:
-
Open your IIS application, and then select the ‘Application Pools’ option in the ‘Connections’ pane on the left.
-
Select the desired application pool, and select the ‘Advanced Settings’ option in the ‘Action’ on the right side.
-
Within the ‘CPU’ group, you are presented with the ‘Limit’, ‘Limit Action’, and ‘Limit Interval’ options.
-
Limit - This value is representative of the CPU limit that will be imposed on the application pool. It is drawn in 1/1000 of a percent. To make things easier use the table below for desired limit percentage to limit value equivalent.
-
Limit Action - This setting will determine what IIS will do with the application pool when the limit is reached. This settings has 4 available options: ‘NoAction’, ‘KillW3wp’, ‘Throttle’, and ‘ThrottleUnderLoad’.
- ’NoAction’ - Self-explanatory but IIS will not impose action against the application pool.
- ’KillW3wp’ - This option authorizes IIS to kill the associated task for the application pool and provisions an HTTP 500 error code until the ‘Limit Interval’ is reached and the ‘Limit’ value is rechecked. While this option lacks a certain grace it is very effective. We do not recommend this option when compared to the throttle and throttleunderload options. KillW3wp is an older option for older IIS installations.
- ’Throttle’ - This option authorizes IIS to restrict further CPU allocation to that application pool instead of killing the associated process the requests that utilize that application pool is slowed down.
- ’ThrottleUnderLoad’ - This option functions exactly like the ‘Throttle’ option with the only exception being when to throttle. This option will only impose the CPU limit action if the CPU is exhibit contention from other processes, hence the “UnderLoad” name designation. I recommend this option for most throttling action to start with and tune the server environment from there.
-
’Limit Interval’ - This setting is used by the ‘KillW3wp’ action to determine how long to kill the application pool inactive. It is not used by either the ‘Throttle’ or ‘ThrottleUnderLoad’ options.
-
-
After you have defined the settings and values for the application pool, select the ‘OK’ button to implement the settings to the application pool. This will restart the application pool and push the settings live.
Limit Quick Reference
Limit Percentage | Limit Value |
---|---|
10% |
10000 |
20% |
20000 |
30% |
30000 |
40% |
40000 |
50% |
50000 |