HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

DBCC CheckDB causing high values for resource_semaphore wait type

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
resource_semaphorewaitdbcchightypecheckdbcausingforvalues

Problem

On one of our production server, where SQL Server 2008R2 (Service Pack 2) is installed with 24 GB memory and 24 CPU cores grouped into two NUMA nodes, we are facing high counts for resource_semaphore waits WHEN we execute DBCC CheckDB for one of our database which is 125 GB in size.

Instance is up for last 6 months and working fine, but this start suddenly while no size change in database and no configuration changes performed.

While

Hard drives are performing up to the mark.

BUT

Strange thing i found is "ideal_memory_kb" values i.e. 5299767576 (5TB) for DBCC Check DB Session

select top 5 ideal_memory_kb,* from sys.dm_exec_query_memory_grants


Is it TempDB issue ?

Is there anything wrong on memory side?

Solution

There is nothing wrong! This is how DBCC CHECKDB works. You can read Jonathan's post explaining this behavior and a workaround if you're on the Enterprise Edition -- DBCC CHECKDB Execution Memory Grants – Not Quite What You Expect

The only strange thing is that usually this happens with servers with larger amount of RAM!

Here is also a really good article on Understanding SQL server memory grant

Memory grant uses "RESOURCE_SEMAHORE" wait type. If you see significant waits on this wait type, you may have an issue with big queries.

Perhaps, if you see a big IO Queue on your SAN, you have a lot of IO bound queries on top of your memory pressure. Check the PLE and Memory Grants Pending counters on this server. If you PLE is very low and you have lots of pending memory grants, your server might benefit from additional memory. Also look if you need to add any indexes (review missing indexes DMV) -- Are you using SQL's Missing Index DMVs?

Context

StackExchange Database Administrators Q#65466, answer score: 3

Revisions (0)

No revisions yet.