Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

后端 未结 20 2405
臣服心动
臣服心动 2020-11-22 10:23

I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2).
I\'ve

20条回答
  •  迷失自我
    2020-11-22 11:02

    If you are using ASP.NET Core with the Startup.cs convention, you can access and set the query command timeout option like this:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddDbContextPool(_ =>
        {
            _.UseSqlServer(Configuration.GetConnectionString("MyConnectionString"), options => 
            {
                options.CommandTimeout(180); // 3 minutes
            });
        });
    }
    

提交回复
热议问题