Search code examples
sql-serverperformance

SQL Server times out connections sometimes up to a few minutes after reboot of PC. Works fine after ~2-5mins


I have developed software that uses SQL Server and Entity Framework .NET to interface with it. After moving forward to SQL 2022 I noticed a new issue I had not seen in previous versions and I was wondering if anyone has any troubleshooting advice.

What happens is that if we reboot the W10 PC and have our software setup to start at boot, it throws SQL connection timeout errors and fails to run properly. This does not seem to be entirely consistent. I had two PC's that were doing that and setting SQL Agent and SQL Server Browser to autostart seemed to resolve that. But we have a handful of PC's where this does not occur. It also seems that SSMS cannot connect as well until a few minutes. After a few minutes have passed, without doing anything at all, it works entirely normally with all connections and queries working as intended. The PC's are modern HP Z series with high end multicore processors and 32GB of ddr4 ram and SSD's. I should not have a hardware bottleneck as far as I can tell.

Ideally what I am looking for is to configure SQL Server 2022 to work as immediately as possible after reboot instead of several minutes sometimes. We are experimenting and troubleshooting with some PC's but I am not super familiar with backend programming/configuration/troubleshooting of SQL Server itself. I would appreciate any advice to narrow down where the problem is.


Solution

  • Turns out that SQL 2022 by default is configured as Automatic (Delayed) start now instead of just Automatic which means it starts after all the Automatic Services. Setting it to Automatic fixed it. Apologies as my post was apparently not clear enough for those that tried to help.