Articles in this section

How to limit IIS worker process memory and CPU consumption on a Plesk server?

Plesk for Windows kb: how-to

Applicable to:

  • Plesk for Windows

Question

A lot of customers use high memory and CPU for their IIS Worker processes. How can the CPU and RAM usage be limited for their IIS Worker processes?

Answer 

In the Plesk it is possible to set basic IIS Application Pool CPU and memory limits as follows:

CPU and RAM limits for the global application pool (server-wide) via the Plesk GUI


1. Go to Tools & Settings > IIS Application Pool:

2. In this menu it is possible to set:

  • The maximum number of worker processes
  • The Idle timeout in minutes
  • The idle timeout action
  • Maximum CPU usage (%)
  • The action (Limit action) that IIS performs when a worker process exceeds the configured maximum CPU usage
  • The reset period (Limit interval in minutes) for monitoring of CPU usage on an application pool
  • Recycling at regular time intervals (minutes)
  • Recycling when the maximum number of requests is reached
  • Recycling when the maximum amount of virtual memory is used
  • Recycling when the maximum amount of private memory is used

Default option for IIS is recycle the pool when the maximum amount of memory was reached.

For multiple domains by adjusting assigned service plan in the Plesk GUI


1. Go to Service Plan > SERVICE_PLAN_NAME > Performance tab

  • The maximum number of worker processes
  • The Idle timeout in minutes
  • The idle timeout action
  • Maximum CPU usage (%)
  • The action (Limit action) that IIS performs when a worker process exceeds the configured maximum CPU usage
  • The reset period (Limit interval in minutes) for monitoring of CPU usage on an application pool
  • Recycling at regular time intervals (minutes)
  • Recycling when the maximum number of requests is reached
  • Recycling when the maximum amount of virtual memory is used
  • Recycling when the maximum amount of private memory is used

 

2. Set required values for the options below:


Managing application pool settings via CLI


As an example, the command below sets the memory usage of application pool to 128MB for example.com :

  1. Log in to the server via RDP

    Note: if direct RDP access to the server is not possible, contact server administrator for further assistance.

  2. Execute the following command in command prompt

    C:\> plesk bin site.exe --set-iis-app-pool-settings example.com -iis-app-pool-turned-on true -recycling-by-virtual-memory 131072 -recycling-by-private-memory 131072

    Note: Values for memory limits set in kilobytes

    Note: The changes will be reflected in Plesk database, in iisapppools table, where iisapppools.ownerId refers to domain's ID.

  3. To apply new limits application pool have to be re-cycled manually as below or automatically by timeout:

    C:\> "C:\Windows\SysWOW64\inetsrv\appcmd.exe" recycle apppool /apppool.name:"example.com(domain)(4.0)(pool)"

Additional information and options can be found on the following page of the Plesk Obsidian documentation:

site.exe: Sites | Plesk Obsidian documentation 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.