From 1e47043c441e5947c980456b0b954e8fe39671f2 Mon Sep 17 00:00:00 2001 From: Blake Drumm Date: Tue, 31 Oct 2023 14:12:00 -0400 Subject: [PATCH] Update the calculation for NUMA :package: --- SQL Queries/maxdop_calculator.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SQL Queries/maxdop_calculator.sql b/SQL Queries/maxdop_calculator.sql index 4458356..76d43ba 100644 --- a/SQL Queries/maxdop_calculator.sql +++ b/SQL Queries/maxdop_calculator.sql @@ -64,14 +64,13 @@ END ELSE BEGIN DECLARE @LogicalCPUsPerNumaNode INT = @NumCPUs / @NumaNodes; + IF @LogicalCPUsPerNumaNode <= 16 SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode; + ELSE IF (@LogicalCPUsPerNumaNode / 2) >= 16 + SET @RecommendedMaxDop = 16; ELSE SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode / 2; - - -- Ensure the MAXDOP does not exceed half the number of logical CPUs per NUMA node - IF @RecommendedMaxDop > @LogicalCPUsPerNumaNode / 2 - SET @RecommendedMaxDop = @LogicalCPUsPerNumaNode / 2; END -- Define a table variable to store the results