Share via

MAXDOP value

Bilal H. Bhatt 136 Reputation points
2024-11-16T06:37:57.4766667+00:00

Hi,

I have a production server with 256 cores/512 logical processors hosting SQL Server 2019 dedicated instance. What value should be optimal for maxdop to run checkdb?

i tried with 32,64 maxdop value but it is taking long time around 36 hours.

I have another server with 72 cores and the same instance, the checkdb with maxdop 24 is just taking 31 hours.

Please advise

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

3 answers

Sort by: Most helpful
  1. Rodger Kong 370 Reputation points
    2024-11-20T05:37:57.4766667+00:00

    Create a Data Collector Set within Performance Monitor will help to locate the issues.

    You can record Avg. Disk Queue Length of PhysicalDisk for each physical disks that contain data&log files to indicate disk workload when DBCC excuting.

    Recording metrics of SQLServer: Wait Statistics will help to find where the bottleneck happened.

    There are many more indicators to help.

    By recording and analysing the same metrics with different MAXDOP value, it might show you what happened after your change MAXDOP.

    enter image description here

    Was this answer helpful?

    0 comments No comments

  2. 博雄 胡 745 Reputation points
    2024-11-19T02:51:45.65+00:00

    It's an interesting question, and I'm curious, because it's as confusing to me as how to set up MAXDOP in production.

    I think maybe the essential question is what factors affect the parallel benefits and the parallel costs, so that the cost of the parallel eventually outweighs the benefits of the parallel.

    IO is obviously a big source of time, if I understand it right, assuming a speed of 500MB/s, the time to create a consistent copy and read it must be at least 14.5*2=29 hours.

    Was this answer helpful?

    0 comments No comments

  3. Erland Sommarskog 134.1K Reputation points MVP Volunteer Moderator
    2024-11-16T09:18:33.2333333+00:00

    Obviously, how long time it takes run DBCC CHECKDB depends on the database. Foremost its size, but maybe also its complexity. These databases must be quite big if it takes this long time to run CHECKDB.

    Also, CHECKDB takes a lot longer time if there actually is corruption, since it performs a lot of extra works. Many moons ago, I looked at the logs on a server to determine what execution time I could expect for the DBCC I was about to start. I found that in some cases it had taken twenty minutes, and in this case DBCC was clean. On other occasions it had taken 6-7 hours, and in this there was corruption in the database.

    I'm afraid that the only way to find out is by some trial and error. And how much CPU power you want to permit for DBCC.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.