CPU Limit in IIS Application Pools / Limitation CPU des Application Pools IIS

Go to English version

Un de mes clients m’a récemment remonté que son journal d’application Système était pollué par l’événement WAS/5025 relatif à IIS. Au premier abord cela paraissait simple : On dépassait le seuil CPU paramétré sur les « application pools » (« 0 » par défaut donc pas de limitation CPU).  Or un petit tour sur l’interface graphique pour les « applications pools » incriminés me montrait une valeur positionnée à 0.

 

De prime abord le problème n’était pas là …

Or il faut se souvenir qu’avant IIS 8.5 le seuil de CPU était exprimé dans l’interface graphique et dans le fichier applicationHost.config en 1/1000 ième de pourcentage. Pour valoriser le seuil CPU à 50% il fallait donc rentrer 50 000. Depuis IIS 8.5 la valeur est exprimée en pourcentage (ce qui est d’ailleurs plus logique) dans l’interface graphique (voir la capture d’écran ci-dessus prise depuis IIS 10.0) mais la valeur demeure stockée en 1/1000 ième de pourcentage dans le fichier applicationHost.config. Ainsi vous rentrez 50 dans l’interface graphique mais la valeur stockée dans le fichier applicationHost.config sera 50 000.

Se pourrait-il que interface graphique puisse m’induire en erreur ? Quelle valeur est affichée dans l’interface graphique si dans le fichier est stockée une valeur inférieure à 1 000 ?

Vérifions à l’aide de l’éditeur de configuration et de PowerShell :

  • Editeur de configuration

 

  • PowerShell

Bingo ! Une valeur 700 (donc 0.7% !!! ==> 700/1000) était étrangement positionnée dans le fichier applicationHost.config.

Après valorisation de la valeur à 0 en PowerShell, les événements WAS/5025 relatifs à IIS ont disparus.

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']/cpu" -name "limit" -value 0

Quelques liens utiles :

Aller à la version française

A customer of mine recently told me that his System application log was flooded by WAS/5025 IIS events. At first it seemed simple: It exceeded the CPU threshold set on the « application pools » (« 0 » by default so no CPU limitation). But a little tour on the GUI for the « applications pools » incriminated showed me a value set to 0.

The problem seems not to be there …

However, it must be remembered that before IIS 8.5 the CPU threshold was expressed in the GUI and in the applicationHost.config file in 1/1000ths of one percent. To value the CPU threshold at 50%, it was necessary to enter 50 000. Since IIS 8.5 the value is expressed as a percentage (which is more logical) in the GUI (see screenshot above taken from an IIS 10.0 server) but the value remains stored in 1/1000ths of one percent in the applicationHost.config file. So you enter 50 in the GUI but the value stored in the applicationHost.config file will be 50 000.

Could it be possible that GUI can mislead me? What value is displayed in the GUI if in the file is stored a value less than 1 000?

Let’s check using the Configuration Editor and PowerShell:

  • Configuration Editor

 

  • PowerShell

 

Bingo! A value of 700 (so 0.7% !!! ==> 700/1000) was strangely positioned in the applicationHost.config file.

After valuing the value at 0 in PowerShell, the WAS/5025 events related to IIS disappeared.

 
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.applicationHost/applicationPools/add[@name='DefaultAppPool']/cpu" -name "limit" -value 0 

Some useful links:

Laurent.

Feel free to share:)