相关疑难解决方法(0)

Asp.Net Core - 已达到配置的 inotify 实例数量的用户限制 (128)

查询mysql数据库(在Ubuntu 14.04/16.04上)一定次数后,asp.net core MVC报告错误,并显示以下消息:“已达到配置的inotify实例数量的用户限制(128)。 ”它可以确定错误是由于控制器打开了太多文件并超出了 iNotify 设置的限制(在/proc/sys/fs/inotify/max_user_instances 中)而引发的。但是当 ASP.NET 在每个 http 请求上打开文件时,我感到很困惑,为什么它没有正确关闭文件?有人也遇到过这个问题吗?备注:我使用的是 Mysql.data.core 和 mysql.data.entityframeworkcore 提供程序。

    private static string classiferstring = "sports,outdoor,startup,pets,child,adult,elderly";

    [AllowAnonymous]
    [HttpGet]
    public async Task<object> Classify([FromQuery] string classifyword)
    {
        string[] classifers = classiferstring.Split(',');
        if (!classifers.Contains(classifyword))
        {
            return new
            {
                status = 0,
                info = "WrongClassifier",
                Data = ""
            };
        }

        try
        {
            var predata = await (from d in _context.descriptor
                              join a in _context.combination on d.ID equals a.ID
                              select …
Run Code Online (Sandbox Code Playgroud)

ubuntu inotify entity-framework-core asp.net-core

6
推荐指数
4
解决办法
8635
查看次数