Query times out from web app but runs fine from management studio

前端 未结 8 1535
盖世英雄少女心
盖世英雄少女心 2020-12-01 05:13

This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.

The problem is that you have one

8条回答
  •  攒了一身酷
    2020-12-01 05:55

    We had the same issue and here's what we found out.

    our database log size was being kept at the default (814 MB) and auto growth was 10%. On the server, maximum server memory was kept at the default setting as well (2147483647 MB).

    When our log got full and needed to grow, it used all the memory from the server and there's nothing left for code to be run so it timed out. What we ended up doing was set database log file initial size to 1 MB and maximum server memory to 2048 MB. This instantly fixed our problem. Of course, you can change these two properties to fit your need but this is an idea for someone running into the timing out issue when executing a stored procedure via code but it runs super fast in SSMS and the solutions above do not help.

提交回复
热议问题