Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Sql server 2008 R2 --- procedure Cache Expand / Collapse
Author
Message
Posted Tuesday, August 09, 2011 9:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 19, 2013 8:28 AM
Points: 31, Visits: 194
Hi

We have a sql server 2008 R2 on physical server with RAM-- 512 gb.
we have around 300 gb of data in disk, the sql server memory has been set to 485gb.
sql server is using around 300gb of the memory.

the question here is, the plan cache hit ratio is only 65%.

can u please help me resolve this and increase the plan cache hit ratio to 100%

we are doing around 7000 batches/sec
we have enabled optimize for ad-hoc workloads to true and forced parameterization.

thanks for the help,
Post #1156960
Posted Tuesday, August 09, 2011 9:19 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:06 PM
Points: 41,495, Visits: 34,416
Are you having performance problems due to the compiles?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1156963
Posted Tuesday, August 09, 2011 9:33 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 19, 2013 8:28 AM
Points: 31, Visits: 194
kind of..

the compiles/sec are almost half of the batches/sec
but as we don't have much load on the system, it is not really affecting.
the end user may see a delay if the query that came in was huge and has to be compiled again.

but we need to fix the compiles. i feel as the proc cache is being cleared, the compiles are going up.
Post #1156987
Posted Wednesday, August 10, 2011 6:06 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 9:58 AM
Points: 2,674, Visits: 694
I guess then that you are not using stored procedures?
I've looked at a couple of apps we have which don't use procs and I notice that often plan reuse just doesn't happen.
You probably need to examine the queries in the cache to see what's not being reused, probably a fairly tedious task. The proc cache will only grow to a certain %age of size so maybe you're actually getting what can be best described as cache paging.
Although the reuse of sql plans/ad hoc queries is much better now it's still not perfect - it's amazing sometimes to see the volume of queries which parametise for msdb.


The GrumpyOldDBA
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
Post #1157544
Posted Wednesday, August 10, 2011 7:28 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 19, 2013 8:28 AM
Points: 31, Visits: 194
That's true, we don't use SP's a lot. Most of the queries are ad-hoc.

why i am concerned about this memory is, we see CMEMTHREAD waits only in this server( version sql server 2008 R2).the other servers( version sql server 2008 sp1) have the same application code and the plan cache hit is low, but there is no CMEMTHREAD wait.


can you please help resolving the CMEMTHREAD waits.
Post #1157604
Posted Wednesday, August 10, 2011 8:04 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, January 16, 2014 12:03 PM
Points: 21,376, Visits: 9,594
I'm not an expert by any means on waits, but you could find this very useful : http://download.microsoft.com/download/4/7/a/47a548b9-249e-484c-abd7-29f31282b04d/Performance_Tuning_Waits_Queues.doc
Post #1157633
Posted Wednesday, August 10, 2011 2:27 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 4:17 PM
Points: 439, Visits: 1,094
Having 512GB of memory lets me think you have a lot of CPUs in that box as well.

If you're seeing loads of CMEMTHREAD waits in SQL Server 2008 R2 on ad-hoc compiles on a server with more than 16 CPU cores, you are likely suffering from a bug in R2. (We dealt with this on a 48-core box)

Update to the latest hotfix. If that doesn't solve it, you may need a specific hotfix from MS Support.

-Eddie


Eddie Wuerch
MCM: SQL
Post #1158035
Posted Wednesday, August 10, 2011 2:31 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Thursday, January 16, 2014 12:03 PM
Points: 21,376, Visits: 9,594
Eddie Wuerch (8/10/2011)
Having 512GB of memory lets me think you have a lot of CPUs in that box as well.

If you're seeing loads of CMEMTHREAD waits in SQL Server 2008 R2 on ad-hoc compiles on a server with more than 16 CPU cores, you are likely suffering from a bug in R2. (We dealt with this on a 48-core box)

Update to the latest hotfix. If that doesn't solve it, you may need a specific hotfix from MS Support.

-Eddie


Do you have the kb link?
Post #1158039
Posted Wednesday, August 10, 2011 2:40 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, February 25, 2014 4:17 PM
Points: 439, Visits: 1,094
Ninja's_RGR'us (8/10/2011)
Eddie Wuerch (8/10/2011)
Having 512GB of memory lets me think you have a lot of CPUs in that box as well.

If you're seeing loads of CMEMTHREAD waits in SQL Server 2008 R2 on ad-hoc compiles on a server with more than 16 CPU cores, you are likely suffering from a bug in R2. (We dealt with this on a 48-core box)

Update to the latest hotfix. If that doesn't solve it, you may need a specific hotfix from MS Support.

-Eddie


Do you have the kb link?


This looks similar, it may be the actual problem. I don't remember the particulars, but we did get the PSS hotfix around the time this KB article was published:

http://support.microsoft.com/kb/2492381
FIX: SQL Server 2008 R2 performs poorly when most threads wait for the CMEMTHREAD wait type if the threads use table variables or temp tables to load or update rowsets


Eddie Wuerch
MCM: SQL
Post #1158049
Posted Wednesday, August 10, 2011 3:59 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 19, 2013 8:28 AM
Points: 31, Visits: 194
We have concluded the same

we are planning to apply SP1.

Thanks for the help, I will let you know about the results after applying the service pack.
Post #1158115
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse