Exploring Windows Containers: Page Files

And down the rabbit hole we go

A few weeks ago I received an excellent question from a community member, which sent me down the fascinating rabbit hole of Windows containers once again. The question, and while I’m paraphrasing, went something along these lines:

“Could you share some information on how page files are allocated in a Windows Server container setting?"

I honestly did not know whether page files would behave differently in a containerized setting, though I suspected that they wouldn’t. I decided to write down and share my findings.

Feel free to read the full blog post!

The test setup

As I was figuring things out, I used a few Azure services to perform my tests. If you'd like to try some of them out for yourself, feel free to do so. I created a Bicep template that provisions a bunch of resources that should make it pretty straightforward to stress test a container and host's memory and associated page file.

I used some platform-as-a-service offerings:

  • Azure Container Registry + Tasks
    • Will automatically pull code and build a Windows container image.
    • Eventually, the built image is pushed into the registry.
  • Azure Container Instance
    • Used to run the built Windows container image.
  • Azure App Service Plan P1V3
    • runs Hyper-V isolated Windows Containers.
  • Azure App Services
    • Used to run the built Windows container image.
    • Memory limit for a single container has been modified to use four-ish GBs of the eight that are available.

And some infrastructure-as-a-service offerings:

  • Two Azure Virtual Machines
    • One Standard_D4s_v3 and one Standard_E4-2s_v4.
    • Visual Studio 2022 latest with Windows Server 2022.
  • Two premium Managed Disks
    • P10/128 Gb disks
  • Two custom script extensions
    • A PowerShell script that installs Docker and the Containers and Hyper-V Windows features.
  • Virtual Network
    • Holds the two VMs.
  • Two public IP addresses
    • Since we need to connect to it without much hassle.
  • Network Security Group
    • Only allows RDP from your IP to the VMs.

Deploy to Azure

Visualize