SQL Server 2019 MAXDOP and Max Memory

%3CLINGO-SUB%20id%3D%22lingo-sub-2870297%22%20slang%3D%22en-US%22%3ESQL%20Server%202019%20MAXDOP%20and%20Max%20Memory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2870297%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20greatly%20appreciate%20some%20advice%20on%20a%20situation%20that%20we%20recently%20had%20of%20which%20I%20am%20trying%20to%20better%20understand.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20two%20Windows%20Server%202019%20Standard%20with%20SQL%20Server%202019%20Web%20Edition%20running%20as%20Gen%201%20virtual%20machines%20at%20a%20hosting%20provider.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServer%20A%20(Prod)%3A%3C%2FP%3E%3CP%3E6%20logical%20processors%20(as%20seen%20by%20Windows)%3C%2FP%3E%3CP%3E24GB%20RAM%3C%2FP%3E%3CP%3E225GB%20disk%3C%2FP%3E%3CP%3EWindows%20Server%202019%20Standard%20(1809)%3C%2FP%3E%3CP%3ESQL%20Server%202019%20Web%20Edition%20(15.0.2080.9)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServer%20B%20(QA)%3A%3C%2FP%3E%3CP%3E6%20logical%20processors%20(as%20seen%20by%20Windows)%3C%2FP%3E%3CP%3E16GB%20RAM%3C%2FP%3E%3CP%3E200GB%20disk%3C%2FP%3E%3CP%3EWindows%20Server%202019%20Standard%20(1809)%3C%2FP%3E%3CP%3ESQL%20Server%202019%20Web%20Edition%20(15.0.2080.9)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInitially%2C%20the%20QA%20server%20was%20configured%20with%20SQL%20Server%20set%20at%20max%20memory%208GB%20and%20MAXDOP%20of%200.%26nbsp%3B%20When%20a%20search%20for%20customers%20is%20run%20from%20the%20corresponding%20web%20site%2C%20it%20triggers%203%20large%20queries%20that%26nbsp%3B%20comb%20through%20about%20900%2C000%20records.%26nbsp%3B%20This%20query%20takes%20about%203%20seconds%20to%20return%20and%20we%20can%20see%20that%20the%20SQL%20Engine%20is%20triggering%20use%20of%20parallelism.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Prod%20server%20was%20configured%20with%20SQL%20Server%20set%20at%20max%20memory%2016GB%20and%20MAXDOP%20of%201.%26nbsp%3B%20When%20a%20search%20for%20customers%20is%20run%20from%20the%20corresponding%20web%20site%2C%20it%20triggers%203%20large%20queries%20that%20comb%20through%20about%20900%2C000%20records.%26nbsp%3B%20This%20query%20takes%20about%2015%20seconds%20to%20return%20and%20we%20can%20see%20that%20the%20SQL%20Engine%20is%20not%20triggering%20use%20of%20parallelism.%26nbsp%3B%20We%20changed%20the%20MAXDOP%20to%200%20to%20match%20the%20QA%20server%20and%20this%20did%20trigger%20the%20use%20of%20parallelism%20but%20the%20query%20time%20was%20only%20marginally%20better.%26nbsp%3B%20When%20we%20set%20the%20MAXDOP%20to%200%26nbsp%3B%20and%20the%20max%20memory%20down%20to%208GB%20the%20query%20now%20runs%20with%20parallelism%20in%20about%203%20seconds.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20understanding%20how%20lowering%20the%20maximum%20amount%20of%20memory%20available%20to%20SQL%20Server%20improves%20the%20performance%20of%20the%20query.%26nbsp%3B%20What%20am%20I%20missing%3F%26nbsp%3B%20Any%20advice%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

I would greatly appreciate some advice on a situation that we recently had of which I am trying to better understand.

 

We have two Windows Server 2019 Standard with SQL Server 2019 Web Edition running as Gen 1 virtual machines at a hosting provider. 

 

Server A (Prod):

6 logical processors (as seen by Windows)

24GB RAM

225GB disk

Windows Server 2019 Standard (1809)

SQL Server 2019 Web Edition (15.0.2080.9)

 

Server B (QA):

6 logical processors (as seen by Windows)

16GB RAM

200GB disk

Windows Server 2019 Standard (1809)

SQL Server 2019 Web Edition (15.0.2080.9)

 

Initially, the QA server was configured with SQL Server set at max memory 8GB and MAXDOP of 0.  When a search for customers is run from the corresponding web site, it triggers 3 large queries that  comb through about 900,000 records.  This query takes about 3 seconds to return and we can see that the SQL Engine is triggering use of parallelism.

 

The Prod server was configured with SQL Server set at max memory 16GB and MAXDOP of 1.  When a search for customers is run from the corresponding web site, it triggers 3 large queries that comb through about 900,000 records.  This query takes about 15 seconds to return and we can see that the SQL Engine is not triggering use of parallelism.  We changed the MAXDOP to 0 to match the QA server and this did trigger the use of parallelism but the query time was only marginally better.  When we set the MAXDOP to 0  and the max memory down to 8GB the query now runs with parallelism in about 3 seconds.  

 

I am not understanding how lowering the maximum amount of memory available to SQL Server improves the performance of the query.  What am I missing?  Any advice would be greatly appreciated.

0 Replies