Sam
Sam

Reputation: 976

Can the memory utilisation in App Services be improved

I have a fairly simple web application running in an App Service plan in Azure, in a B1 service plan. This plan provides for 1 CPU and 1.75GB of RAM.

The CPU usage never goes above about 5%, and the memory usage is never below 52%.

I did stop the only site running in the plan and the memory usage didn't go down at all. I created a new App Service plan and left it run for a day, and the minimum memory usage was 50% over that time, with no apps running in it.

I know that the reason for this is likely the OS and the services running on the OS, but it's very frustrating getting 50% of the ram that I'm paying for - my app is going to grow over time.

Are there any things I can do to the plan itself, to lower the memory consumption?

With regards to the app, other than disabling features I don't need (like Python and PHP), and setting the app to be 32 bit, are there options there?

Upvotes: 3

Views: 2084

Answers (1)

Matthew Steeples
Matthew Steeples

Reputation: 8058

That's just how these services work. The 50% is going towards running the operating system (which is probably already fairly well tuned to run as little as possible). It's probably worth mentioning that this number won't remain at 50% when you scale up. If we work on the principle that 900mb is being taken up by "infrastructure", then that number will most likely remain constant when you scale up. So doubling up to the 3.5gb model will mean that the OS is taking up 25% of your available memory.

If you don't access the *.scm.azurewebsites.net site then it won't take up any memory (as it won't be loaded), and if you're sharing the app service plan with other apps of your own then disabling "Always On" will mean that your apps won't take up any memory if they're not being used.

The only services that I'm aware of that don't include the OS in the available memory that you can use are Azure Functions / AWS Lambda.

Upvotes: 2

Related Questions