-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing GC Heap Counts with Containers #71413
Comments
Tagging subscribers to this area: @tommcdon Issue DetailsTesting GC Heap Counts with Containers@Maoni0 asked me do to a test pass to validate a doc we're working on. I thought it would be useful to share the results. The short version is the product did what I expected for the scenarios I tested. Context: dotnet/designs#267 Let's test! The first set of tests are using my Apple M1 laptop. It's 8 cores but Docker Desktop limits itself to 4 cores by default (and I didn't change that). I'll show all the steps the first time and then skip for the remaining examples. dotnet-dump tool: https://docs.microsoft.com/dotnet/core/diagnostics/dotnet-dump 1 CoreNote: that I'm using the
2 cores% docker run --rm --cpus 2 -d --name aspnetapp -p 8000:80 mcr.microsoft.com/dotnet/samples:aspnetapp
2 cores + DOTNET_PROCESSOR_COUNT=3
2 cores + DOTNET_PROCESSOR_COUNT=10
3 cores (CPU affinity)
Low memory; cores unconstrained
Ubconstrained
Ubconstrained + DOTNET_GcHeapCount=2
Big machine unconstrainedNote: I've switched to a big 64 core x64 machine in Azure, so am now using the
Big machine -- memory constrained
|
Tagging subscribers to this area: @dotnet/gc Issue DetailsTesting GC Heap Counts with Containers@Maoni0 asked me do to a test pass to validate the container limits doc we're updating. I thought it would be useful to share the results. The short version is the product did what I expected for the scenarios I tested. Let's test! The first set of tests are using my Apple M1 laptop. It's 8 cores but Docker Desktop limits itself to 4 cores by default (and I didn't change that). I'll show all the steps the first time and then skip for the remaining examples. dotnet-dump tool: https://docs.microsoft.com/dotnet/core/diagnostics/dotnet-dump 1 CoreNote: that I'm using the
2 cores% docker run --rm --cpus 2 -d --name aspnetapp -p 8000:80 mcr.microsoft.com/dotnet/samples:aspnetapp
2 cores + DOTNET_PROCESSOR_COUNT=3
2 cores + DOTNET_PROCESSOR_COUNT=10
3 cores (CPU affinity)
Low memory; cores unconstrained
Ubconstrained
Ubconstrained + DOTNET_GcHeapCount=2
Big machine unconstrainedNote: I've switched to a big 64 core x64 machine in Azure, so am now using the
Big machine -- memory constrained
|
I am wondering if it makes sense to mention in the doc that these cgroup or job object settings are only read during process startup. Once the GC is initialized, it won't read these settings anymore and therefore it won't pick up any changes. There is a proposal and a prototype for refreshing these limits on user request, but this is not in the scope of .NET 7. The prototype cannot adjust the number of heaps dynamically, that would be much more involved. |
I added a point about that. Good call. |
@richlander can this be closed? |
Yup. |
Testing GC Heap Counts with Containers
@Maoni0 asked me do to a test pass to validate the container limits doc we're updating. I thought it would be useful to share the results. The short version is the product did what I expected for the scenarios I tested.
Note: the cgroup values are only read on process startup. Changing these values afterwards will have no effect. Enabling a dynamic scenario could be considered in future.
FYI: @omajid @jkotas
Let's test!
The first set of tests are using my Apple M1 laptop. It's 8 cores but Docker Desktop limits itself to 4 cores by default (and I didn't change that).
I'll show all the steps the first time and then skip for the remaining examples.
dotnet-dump tool: https://docs.microsoft.com/dotnet/core/diagnostics/dotnet-dump
FYI: One of my reviewers mentioned that
ps
wasn't needed sincedotnet-dump ps
does the same thing but only lists .NET process, which actually makes the process easier.1 Core
Note: that I'm using the
linux-arm64
version ofdotnet-dump
. Link: https://aka.ms/dotnet-dump/linux-arm642 cores
2 cores + DOTNET_PROCESSOR_COUNT=3
2 cores + DOTNET_PROCESSOR_COUNT=10
Note: Docker desktop only gave me 4 cores on my laptop, as mentioned at the top. The
DOTNET_PROCESSOR_COUNT=10
value is asking for more cores than the machine has.3 cores (CPU affinity)
Low memory; cores unconstrained
Ubconstrained
Unconstrained + DOTNET_GcHeapCount=2
Big machine unconstrained
Note: I've switched to a big 64 core x64 machine in Azure, so am now using the
linux-x64
version ofdotnet-dump
. Link: https://aka.ms/dotnet-dump/linux-x64.Big machine -- memory constrained
The text was updated successfully, but these errors were encountered: