.net core 报错 the configured user limit (128) on the number of inotify instances has been reached

在运行ASP.NET Core应用时遇到报错:configured user limit (128) on the number of inotify instances已达到。问题源于频繁读取JSON文件时创建了过多的文件监视器。解决方案包括修改文件监视器的配置或使用依赖注入抽象处理方式。
摘要由CSDN通过智能技术生成

部署一个asp.net core程序,用着用着占用线程数越来越多,看报错日志发现这么一行:the configured user limit (128) on the number of inotify instances has been reached。

谷歌查到Stackoverflow上也有人遇到这个问题,原来是读取json文件造成的。

var builder = new ConfigurationBuilder()
            .AddJsonFile($"appsettings.json", true, true)
            .AddJsonFile($"appsettings.{environmentName}.json", true, true)
            .AddEnvironmentVariables();
        var configuration = builder.Build();

原因是:You are creating file watchers, every time you access an setting. The 3rd parameter is 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值