Azure-docs: Windows container memory limit

Created on 11 Aug 2018  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

Is the Windows container suppose to have 1GB memory limit by default? When following the above example to create a containerized web app in the portal (or using ARM templates) using one of the cached base images, it seem to crash quickly with out of memory error around 1GB, despite the app service plan have 32GB memory. This only affects Hyper-V container app service plan ("Xenon" kind).

Example from Windows container:

PS C:\> systeminfo | findstr "Memory"
Total Physical Memory: 1,023 MB
Available Physical Memory: 529 MB
Virtual Memory: Max Size: 1,023 MB
Virtual Memory: Available: 555 MB
Virtual Memory: In Use: 468 MB

PS C:\> wmic OS get FreePhysicalMemory /Value
FreePhysicalMemory=530860

PS C:\> wmic computersystem get TotalPhysicalMemory
TotalPhysicalMemory
1072742400


Document details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 app-service-wesvc cxp in-progress product-question triaged

Most helpful comment

@joakimhellum-in We had to reach out to the product group in order to get you a response. Windows containers are brand new and still in preview state.

We will change the defaults to match the setting of the Hyper-V host to take full advantage of the selected App Service Plan compute power. Currently, we don’t allow customers to control the limits per container but thanks for the feedback

We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

All 7 comments

Thanks for your feedback! We will investigate and update as appropriate.

@joakimhellum-in We had to reach out to the product group in order to get you a response. Windows containers are brand new and still in preview state.

We will change the defaults to match the setting of the Hyper-V host to take full advantage of the selected App Service Plan compute power. Currently, we don’t allow customers to control the limits per container but thanks for the feedback

We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

The fix has been checked in and will be deployed soon. It should be available by end of September

Not sure what the "fix" was, but we had the same problem. It seems Windows Containers on AppService are "limited" to 1.5GB RAM per default.
I searched and found a comment from @apwestgarth that there is a config key available: http://disq.us/p/26gru0x
With the "CONTAINER_MEMORY" (see here) switch I could successfully increase the memory limit. Wouldn't it make sense to document this properly? @BryanTrach-MSFT

For GA, those settings will be renamed as:
WEBSITE_CPU_CORES_LIMIT and WEBSITE_MEMORY_LIMIT_MB

What is the current default size for memory? Is it 1GB or 1.5GB? I tested it yesterday, but wasn't sure if I read the values correct.

The default is 1GB per container.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianpowell2017 picture ianpowell2017  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

Favna picture Favna  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments