0

I note that Apps declared within an Azure Container Apps environment can be configured with a memory allocation from as low as 0.1Gb up to 4 Gb and in any increment of 2 decimal places e.g. 1.25 would be 1 Gig 256Mb. I also understand that Azure Container Apps only supports Linux docker images hence I will have to deploy my .Net app to a Linux docker image, that will be a first for me.

My question: Could someone, with experience of running a containerized .Net Core application in Linux Docker images, indicate what is the baseline container memory size I should specify for a simple grpc webapi app running in Azure Container Apps?

This blog post shows a memory trace of a .net app in a container with a working set of just 20Mb.

camelCase
  • 1,549
  • 2
  • 16
  • 28

1 Answers1

1

It's hard to say exactly how much memory your app will need. However, when you set that value, you're specifying how much memory you want to allocate to your app.

One way to check for your particular app, if you have built a container you can run it locally, exercise your apis/scenarios, maybe connect few clients, etc and watch the docker stats output for how much memory your container is taking.

for example:

$ docker run -d -p 8080:80 mcr.microsoft.com/dotnet/samples:aspnetapp
bc694841b200d6c66504065415c4fc27421e0da8bc27c719aea31b9e6aab5508

$ docker stats

shows this for me

CONTAINER ID   NAME            CPU %     MEM USAGE / LIMIT     MEM %     NET I/O     BLOCK I/O   PIDS
bc694841b200   naughty_rubin   0.01%     92.15MiB / 15.49GiB   0.58%     946B / 0B   0B / 0B     24

so that sample app is using 92 MiBs

ahmelsayed
  • 7,125
  • 3
  • 28
  • 40
  • This is very useful feedback, thankyou. I am getting the impression that a 0.25 to 0.5 Gb memory allocation is ok for a small .Net 7 app receiving grpc calls. My proposed application will spend a portion of the day in an idle state but will need to respond sub second to fresh inbound calls when in an idle state. Azure Container Apps seems like an ideal host for this workload. – camelCase Nov 12 '22 at 11:17