Question:
I am trying to set cpu rate limit i was able to perform this action in UI using the action link
https://theitbros.com/set-cpu-usage-limit-for-an-application-pool-iis-8/
but i want to set three values below using powershell
1 2 3 4 |
CPU limit=20% CPU limit Action= Killw3p Cpu Limit Interval= 1 |
Iam already using powershell to setup startmode to always running.
1 2 |
set-itemproperty IIS:\AppPools\AddressBroker.API -name startMode -value AlwaysRunning |
I have tried something like below but does not work.
1 2 |
set-itemproperty IIS:\AppPools\AddressBroker.API -name CPU -value Limit=20% |
Answer:
I figured out the correct command that works for me is below.
1 2 |
C:\windows\system32\inetsrv\appcmd.exe set apppool AppPOOLName /cpu.limit:20000 /cpu.action:KillW3wp /cpu.resetInterval:00:01:00 |