question

RobertGalante-0992 avatar image
0 Votes"
RobertGalante-0992 asked RobertGalante-0992 answered

Azure App Service set to manually scale 2 instances is running 4 instances. Why?

I have an app service which is running a razor pages app. I conducted a load test today. I scaled the app service manually to 2 instances.

182459-live-load-test-2-instances.jpg


I ran a 5 minute test and watched the application insights dashboard. I saw 2 instances. At the end the test, I saw 4 instances.

182425-live-load-test-2-instances-4-servers-2.jpg


Am I being charged for all 4 instances?

For now, I scaled back down to 1 instance. But I cannot continue my load tests because I have 4 instances running and I don't want 4 instances running.

How do I get rid of these instances?

Thank you for your consideration.
182460-live-load-test-2-instances-4-servers.jpg


An hour later, I still have 2 instances running even though I scaled down to 1 instance more than an hour ago.

azure-webappsazure-webapps-scaling
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

24 hours later, I still have two instances running.

0 Votes 0 ·
ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ajkuma-MSFT converted comment to answer

RobertGalante-0992, Firstly, please accept my delayed response on this.

From your last screenshot, it looks like you’re pointing to Live Stream ‘4’ servers may not be related to Azure App Service and maybe Azure Media Service.

--Just to highlight, there are **two main processe**s for an Azure web app. There is the w3wp.exe process, which runs the website itself.
The second main process is the w3wp.exe scm process, which runs KUDU.

--You can observe your site processes by navigating to (replace yoursitename with your web app name) https://yoursitename.scm.azurewebsites.net/ProcessExplorer/

--Furthermore, if you have multiple Apps in an App Service Plan (ASP). All the apps in the same ASP share the same compute resources.

In a nutshell, the ASP is the scale unit of the App Service Apps. If the plan is configured to run 4 VM instances, then all apps in the plan run on all 4 instances.
--If the plan is configured for autoscaling, then all apps in the plan are scaled out together based on the autoscale settings. You pay for the ASP, not for # the Apps.

--VM name(starts with RD), you may check this discussion thread for more info.

--You may also review the scaling operations via "Diagnose and solve problems", by navigating to Azure Portal and select the WebApp in question.

Diagnostics -scaling


Kindly let us know, if the issue still persist, I'll follow-up with you privately further to provide quick and specialized assistance.




image.png (17.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello,

Thanks for your response.

The application insights dashboard still indicates that I have 2 servers running.

I looked at the process explorer and I saw two w3wp processes. Am I correct that both of these processes are running on one server? Or is the KUDU service running on its own server instance? That would explain the additional server that appears in the dashboard.

I have modified my scaling configuration to use auto-scaling. It is set to 1 instance at the moment. It will auto-scale to 3 instances if the demand increases.

I do have multiple apps, but they should be running on the same instance.

I don't think I'm being charged for the second instance. I will evaluate the charges at the end of the month.

0 Votes 0 ·

rmgalante, Thanks for the follow-up and additional info.

Yes, you’re correct. The Kudu service site runs in the same sandbox as the site. By default, it runs in the different process as the site.
The only thing that really 'connects' the Kudu site to the real site is the file system, and that works regardless of what process or machine they each run on. They’re not charged.

“I ran a 5 minute test “ -If you mention what specific tests you’re running also helps.
If you still have issues and questions, please let me know I’ll follow-up with you further for much deeper investigation.

You may also check this doc- Kudu architecture


To benefit the community find the right answers, please do mark the post which was helpful by clicking on Accept Answer’ & ‘Up-Vote’.


0 Votes 0 ·
RobertGalante-0992 avatar image
0 Votes"
RobertGalante-0992 answered

I submitted a request to MS support for clarification on how MS charges for an App Service plan using S1 machines.

They told me in their response that the S1 machines require more than one server per instance. That is why I see twice the number of servers in the Application Insights.

Also they told me that I will not be charged for the additional servers.

It's not very intuitive to have Application Insights reporting the number of server the way it does. But at least I know now.

I have another App Service Plan with Linux B1 machines. These do not report to Application Insights with a different number of servers. When I mentioned this to them, they replied that the B1 machine only require 1 server per instance.

Thanks for your help through this experience. I think we can close this issue.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RobertGalante-0992, Thanks for the follow-up and update.

Glad you found the information that you're looking for. In regards to, your feedback on Application Insights better reporting on those servers for S1 machines, I'll relay your feedback internally to our product team. Much appreciate your feedback.

To benefit the community, I'll summarize the answer. Your positive feedback is much appreciated.


Please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.

0 Votes 0 ·