admin管理员组文章数量:1399927
Every time when I deploy my ASP.NET service to Azure App Service, the CPU usage of my App Service Plan reaches to 95%. After deployment completes, the CPU usage will be back to normal.
I failed to use the Azure Proactive CPU monitoring tool to collect dump files because the CPU usage of each w3wp process never exceeds 25% (the min CPU usage threshold for dump collection is 50%). However, I got below CPU usage logs from the tool.
Before Deployment - One w3wp process is running and consumes 0% CPU
During Deployment - Multiple w3wp processes are started and each of them consumes 25% of CPU
During Deployment - More w3wp processes are created
Finishing Deployment - Only one w3wp process remains and consumes 0% of CPU
My Azure App service has two deployment slots, however, I do not understand why there are more than three w3wp processes are created during deployment.
Any thoughts on why this is happening? Any suggestion on how to reduce the CPU usage is also welcome! Thanks in advance.
Every time when I deploy my ASP.NET service to Azure App Service, the CPU usage of my App Service Plan reaches to 95%. After deployment completes, the CPU usage will be back to normal.
I failed to use the Azure Proactive CPU monitoring tool to collect dump files because the CPU usage of each w3wp process never exceeds 25% (the min CPU usage threshold for dump collection is 50%). However, I got below CPU usage logs from the tool.
Before Deployment - One w3wp process is running and consumes 0% CPU
During Deployment - Multiple w3wp processes are started and each of them consumes 25% of CPU
During Deployment - More w3wp processes are created
Finishing Deployment - Only one w3wp process remains and consumes 0% of CPU
My Azure App service has two deployment slots, however, I do not understand why there are more than three w3wp processes are created during deployment.
Any thoughts on why this is happening? Any suggestion on how to reduce the CPU usage is also welcome! Thanks in advance.
Share Improve this question edited Mar 26 at 6:42 Tiny Wang 16.4k2 gold badges18 silver badges38 bronze badges asked Mar 26 at 2:51 Yu LanYu Lan 13 bronze badges 6- What is your App Service Plan SKU? – Aslesha Kantamsetti Commented Mar 26 at 7:30
- I don't think the high CPU symptom is an issue as the deployment is succecssful without any error, the high CPU is due to more w3wp instances are created during the deployment. Therefore what we need to investigate is why there's more than 2 w3wp instances although you only have 2 slots. I'm afraid this comes from Azure App service optimization. For example, to make sure your application always accessible even if you are doing a deployment, Azure will create a new instance to host the new publishment and after that, switch the old version to new version seamlessly. – Tiny Wang Commented Mar 26 at 7:42
- In the deployment-best-practice document, it mentioned high CPU might cause the deployment failed, if you are also worry about it, maybe you can follow the suggestion to temporarily scale up your instance count to perform the deployment. – Tiny Wang Commented Mar 26 at 7:45
- @AsleshaKantamsetti it is Isolated I2V2, which is 4 cores, 16GB memory – Yu Lan Commented Mar 26 at 8:11
- Hi @TinyWang, yes, upgrade our service plan is a solution, however, right now we cannot afford to upgrade the plan as the regular service usage is very low. The high CPU issue only occurs during the deployment, which causes our service fail to deploy from time to time.. – Yu Lan Commented Mar 26 at 8:15
1 Answer
Reset to default 0Although you'd intuitively think that only 1 extra instance is created for Slots, the Microsoft documentation here^1 is more complex and involves multiple restarts for each of the Source and Target Slots.
I've tried to summarise it as best I understand. This is for a single app with two Slots. In brackets, I've kept a count of how many instances have been created during the process.
- The original Target Slot app (1)
- Apply the target settings over the Source slot causing it to restart +1 (2)
- If local cache is enabled, restart the Source slot again +1 (3)
- Verify the Source slot is now running with the target settings (3)
- Swap the routing over, so Source becomes Target (3)
- What was previously the Target slot is now the Source slot. Copy the original Source settings over to it, causing a restart of the new Source slot +1 (4)
I count that as 4 different application instances created during a single swap operation. The caveat is that the documentation doesn't mention at which stage it waits for each instance to fully shut down.
So, I think this means there will be at least 2 instances in memory at any given time as a best-case, but possibly up to 4 if it doesn't wait for full shutdowns of each.
本文标签: performanceHigh CPU usage during Azure App Service deploymentStack Overflow
版权声明:本文标题:performance - High CPU usage during Azure App Service deployment - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744167202a2593605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论