-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
This issue is directly related to and a followup of dotnet/aspnetcore#7531 since that issue has been locked. The same issue occurs now in .NET Core 3.1. Following the previous thread, I was able to specify a different user in my Dockerfile to limit this problem which occurs when putting too many docker containers on the same host that are using the same user UID. Our teams now use a randomized UID to ensure each immutable build has its own ID:
RUN useradd --uid $(shuf -i 2000-65000 -n 1) app
USER app
This works to limit the issue, but the problem still continues if you intend to run the same instance of that immutable container with 9 or more instances on the same container orchestrator host. For example if I use the following image: "FROM mcr.microsoft.com/dotnet/core/aspnet:3." to run a base default / empty ASP.NET Core application with the following Program.cs (and usage of zero-configuration files):
Host.CreateDefaultBuilder(args)
.ConfigureWebHost(builder =>
{
builder
.UseKestrel()
.UseStartup<Startup>();
});
Run a default app in the container above, and attach your shell and execute the following to count the number of watchers:
apt-get install lsof
lsof | grep inotify
.NET Core 3.1 shows me generally 15 or 16, while .NET Core 2.1 default app shows more like 40.
If I am running 8 containers each taking at least 15 instances of the 128 limit - I run out pretty quickly.
General concerns:
- Scaling is the first concern I have for obvious reasons (depending on my placement strategy). Is the expectation that I should be increasing this limit on my orchestrator hosts to allow for this?
- With a default execution of ASP.NET Core 3.1 that uses no configuration files, why am I seeing 15 instances? Typically speaking in a container there is very little reason I even want to watch files (especially not configuration files) since its entirely immutable. Is there a way to entirely turn off the inotify watcher instances all together (which would solve this problem entirely)? Or is there an underlying bug in ASP.NET Core here?
EDIT by @Rick-Anderson #28387 mitigates the problem.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status