Skip to content

Commit

Permalink
Update the calculation for NUMA 📦
Browse files Browse the repository at this point in the history
  • Loading branch information
blakedrumm authored Oct 31, 2023
1 parent 9b4a51e commit 1e47043
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SQL Queries/maxdop_calculator.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1e47043

Please sign in to comment.