1
  • We have two node Windows Server cluster with installed SQL Server (2019 Standard Edition) Clustered instances on each node
  • There are 500 active databases
  • There are no any Availability Groups or any other HA solutions configured
  • All databases are on Simple recovery mode
  • VLF count and size are not so big
  • Both nodes are virtualized Windows Server 2019 with 64 GB of memory and 16 cores.

After patching the passive node and rebooting it, we've tried to failover to that node. But surprisingly it took ~ 10 minutes to start the SQL Server service which hanged on change pending state. In regular case without patching it takes ~ 10 seconds. I know from Microsoft documentation that downtime depends on the failover time and the overall time for database upgrade scripts execution:

This process results in downtime limited to one failover time and database upgrade script execution time during the whole failover cluster upgrade.

This downtime period seems to me very long, just searching for ways to decrease it somehow. If you have any suggestions, I'll be more than happy to listen to them.

0

2 Answers 2

5

After patching the passive node and rebooting it, we've tried to failover to that node. But surprisingly it took ~ 10 minutes to start the SQL Server service which hanged on change pending state.

After patching, as you've astutely stated, upgrade scripts still need to run against every database. Currently, there are 500 databases on a server with 16 cores, which results in a value of 704 for max worker threads. While I don't necessarily believe you're hitting a MWT issue (though the errorlog would tell you and we don't have the errorlog) I do believe you're having a combination of too much work on too little of a system. It's not enough to bring the system down or crash anything but enough to make it take time to finish processing items. This is also a VM, we have no idea about the host or what it may or may not be doing in terms of resource fairness.

This downtime period seems to me very long, just searching for ways to decrease it somehow. If you have any suggestions, I'll be more than happy to listen to them.

Since I don't have a copy of the errorlogs or performance counters, it's hard to be exact or accurate, so the above is based off the data we currently have. Any number of other factors can be involved here, including disk access times, other items on the server, available and max server memory, etc.

There's no single knob or item, unless you have data that shows X was slow or Y took a long time - then you can hone in on that. Currently it does seem as though you have many databases on the system for the number of CPUs available.

If you have a similar setup test system, you can setup performance captures and run the patching process -> failover, to get more information.


From the comments:

Unless it's changed since 2016 (and AFAIK it hasn't), the upgrade scripts run through the databases serially (so MWT won't come into play) [...]

This is not correct, at least since 2005 it's not worked that way. Databases will be started in parallel and upgrade as shown below which is an excerpt from a CU update I ran after creating 500 dummy databases.

2023-04-25 05:44:27.98 spid20s     Starting up database 'BreakMeDB1'.
2023-04-25 05:44:27.98 spid21s     Starting up database 'BreakMeDB2'.
2023-04-25 05:44:27.98 spid22s     Starting up database 'BreakMeDB3'.
2023-04-25 05:44:27.99 spid31s     Starting up database 'BreakMeDB12'.
2023-04-25 05:44:27.99 spid33s     Starting up database 'BreakMeDB14'.
2023-04-25 05:44:27.99 spid32s     Starting up database 'BreakMeDB13'.
2023-04-25 05:44:27.99 spid27s     Starting up database 'BreakMeDB8'.
2023-04-25 05:44:27.99 spid29s     Starting up database 'BreakMeDB10'.
2023-04-25 05:44:27.99 spid34s     Starting up database 'BreakMeDB15'.
2023-04-25 05:44:27.99 spid28s     Starting up database 'BreakMeDB9'.
2023-04-25 05:44:27.99 spid23s     Starting up database 'BreakMeDB4'.
2023-04-25 05:44:27.99 spid24s     Starting up database 'BreakMeDB5'.
2023-04-25 05:44:27.99 spid30s     Starting up database 'BreakMeDB11'.
2023-04-25 05:44:27.99 spid25s     Starting up database 'BreakMeDB6'.
2023-04-25 05:44:27.99 spid26s     Starting up database 'BreakMeDB7'.
3
  • Unless it's changed since 2016 (and AFAIK it hasn't), the upgrade scripts run through the databases serially (so MWT won't come into play) and in my experience the process takes 2-3 seconds per database. 2 seconds * 500 databases = 16 minutes so depending upon the storage specs, 10 minutes bring SQL Server online post-update is faster than I'd expect - OP is doing well!
    – alroc
    Commented Apr 25, 2023 at 1:48
  • @alroc That's incorrect, it will not wait for each database and databases will opened in parallel. I'll update my answer to reflect this. Commented Apr 25, 2023 at 12:48
  • That does not match my experience when I managed an instance with several thousand databases.
    – alroc
    Commented Apr 26, 2023 at 22:20
0

It's a good practise when you use FC on virtualized SQL Server instances, to make sure that each node is hosted on a different physical host. Are both of your VMs on the same host? If they are, you may face a resource allocation problem on the hypervisor level, while the service instance is trying to allocate resources after taking over the cluster. Of course that is a guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.