AKS icon indicating copy to clipboard operation
AKS copied to clipboard

[BUG] The configured user limit (1024) on the number of inotify instances has been reached

Open sdwerwed opened this issue 2 years ago • 13 comments

Describe the bug Once we deploy more than 3 .NET pods in AKS we get the following error

  Unhandled exception. System.IO.IOException: The configured user limit (1024) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.
  at System.IO.FileSystemWatcher.StartRaisingEvents()
  at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
  at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
  at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
  at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
  at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0()
  at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
  at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
  at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
  at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
  at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
  at Microsoft.Extensions.Hosting.HostBuilder.Build()
  at xxxxxxxxxxxxxxx.Platform.AuthServer.Program.Main(String[] args) in /src/xxxxxxxxxxxxxxx.Platform.AuthServer/Program.cs:line 14

Each pod consumes about 550 inotify instances.

Expected behavior I would expect to be able to create multiple .NET pods in the AKS or I would expect to be able to configure sysctl -w fs.inotify.max_user_instances=1048576 so I can create more than 3 pods per node.
I see in the official documentation it is supported fs.inotify.max_user_watches but not fs.inotify.max_user_instances.

Possible Solution Add the fs.inotify.max_user_instances in the Linux custom OS configuration settings.

Environment (please complete the following information):

  • AKS 1.25.6

Workaround As a workaround, we have set a daemonset with root access to perform sysctl -w fs.inotify.max_user_instances=1048576. However, this solution has some implications, for example, pods will not start if daemonset will not be scheduled first, or it adds some vulnerabilities to the AKS as we do not want to run any pod with root access and is increasing the operational costs.

sdwerwed avatar Jun 13 '23 10:06 sdwerwed

This is a blocker for us as well. fs.inotify.max_user_watches is supported but not fs.inotify.max_user_instances not. We would like this as soon as possible. related to this https://github.com/Azure/AKS/issues/772

dinfdsooff avatar Jun 13 '23 12:06 dinfdsooff

Action required from @Azure/aks-pm

ghost avatar Jul 13 '23 19:07 ghost

we are also facing this issue

thiDucTran avatar Jul 22 '23 02:07 thiDucTran

Issue needing attention of @Azure/aks-leads

ghost avatar Aug 06 '23 06:08 ghost

@justindavies could you help take a look

wangyira avatar Sep 01 '23 18:09 wangyira

We’re running into this exact problem as well. Can we get some attention to this issue and determine if it’s an issue with dotnet vs aks

Kenneth-Abrams avatar Apr 12 '24 01:04 Kenneth-Abrams

@juan-lee

haitch avatar Aug 27 '24 18:08 haitch

Updating this as a feature request for "Add the fs.inotify.max_user_instances in the Linux custom OS configuration settings".

allyford avatar Sep 05 '24 00:09 allyford

This issue has been automatically marked as stale because it has not had any activity for 30 days. It will be closed if no further activity occurs within 7 days of this comment. @allyford

This issue will now be closed because it hasn't had any activity for 7 days after stale. sdwerwed feel free to comment again on the next 7 days to reopen or open a new issue after that time if you still have a question/issue or suggestion.