IIS 7 and Above
IIS powershell performance
Last post Jul 25, 2019 08:30 AM by llarsson
Jul 24, 2019 02:49 PM|llarsson|LINK
I have performance issues with powershell integration. Is following scenario known? Workaround or information on how to troubleshoot performance?
The first instance I am looking at where it becomes slow is:
Powershell prompt 1)
ConvertTo-WebApplication -ApplicationPool $pool $path
Set-ItemProperty $path -Name enabledProtocols -Value "http,net.tcp"
# Slow - repeatable slow - taking seconds to complete the following query:
Get-WebApplication -Site "Default Web Site" -Name $path2
Powershell prompt 2)
# Faster than prompt 1 - immediate response
Major Minor Build Revision
----- ----- ----- --------
5 0 10586 117
Jul 25, 2019 03:29 AM|Jalpa Panchal|LINK
This issue occurs because the New-WebApplication and ConvertTo-WebApplication cmdlets generate a high volume of COM calls.
To work around this behavior, run PowerShell by using the -mta switch:
Another workaround, run PowerShell by using the -version 2 switch:
Powershell.exe -version 2
Could you share which operating system you are using?
Jul 25, 2019 08:30 AM|llarsson|LINK
Thought it happen on like all our servers but now that I checked I can only see it on 2008R2 (2 out out 4-5 checked) - at least that scale less than 1 second vs around 6-16 seconds.
Thanks been bugging me a few times over the year.
The version seems more scare, the -mta workes for this issue on 2008R2. So thanks one big slow down is fixed.