clearing SQL cache

  • Hello,

    We have our application running on sql server 2005. Recently we started slowing down of the database and timeouts. Once we clear the SQL cache, it turns normal again. What all can be the causes of this issue we are facing. And what can we do to avoid this. Please help!

  • Are you getting any error messages along with the slowdown or are you just experiencing general slowness? Are you seeing application timeouts?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Do you mean the procedure cache (DBCC FREEPROCCACHE) or the buffer cache(DBCC DROPCLEANBUFFERS) ?

    Im guessing the former, could potentially be parameter sniffing http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html



    Clear Sky SQL
    My Blog[/url]

  • What service pack is your sql2005 on ?

    Please post the result of

    select @@version

    or

    Select Serverproperty( 'ProductVersion' ) as ProductVersion

    , Serverproperty( 'ProductLevel' ) as ProductLevel

    , Serverproperty( 'ResourceLastUpdateDateTime' ) as ResourceLastUpdateDateTime

    , Serverproperty( 'ResourceVersion' ) as ResourceVersion

    , Serverproperty( 'Edition' ) as Edition

    , Serverproperty( 'EditionID' ) as EditionID

    What action did you perform to "clear the cache" ?

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Dave Ballantyne (4/7/2010)


    Do you mean the procedure cache (DBCC FREEPROCCACHE) or the buffer cache(DBCC DROPCLEANBUFFERS) ?

    Im guessing the former, could potentially be parameter sniffing http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html

    I like guessing games 🙂

    My guess is procedure cache bloat due to ad-hoc queries.

    http://blogs.msdn.com/sqlprogrammability/archive/2007/01/23/4-0-useful-queries-on-dmv-s-to-understand-plan-cache-behavior.aspx

    DBCC FREESYSTEMCACHE('SQL Plans');

  • vkkrishn,

    Do you have any of the information / answers for the questions asked?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Paul White NZ (4/7/2010)

    My guess is procedure cache bloat due to ad-hoc queries.

    Which reminds me , ive still got a half finished blog on forced parametrization hanging around.



    Clear Sky SQL
    My Blog[/url]

  • Dave Ballantyne (4/7/2010)


    Paul White NZ (4/7/2010)

    My guess is procedure cache bloat due to ad-hoc queries.

    Which reminds me , ive still got a half finished blog on forced parametrization hanging around.

    Well get on with it then!!!

    :laugh: 😀 😛

  • vkkrishn (4/6/2010)


    Hello,

    We have our application running on sql server 2005. Recently we started slowing down of the database and timeouts. Once we clear the SQL cache, it turns normal again. What all can be the causes of this issue we are facing. And what can we do to avoid this. Please help!

    We ran into this exact situation not long ago, and what I found was SQL created different cached execution plans based on the parameters we were passing into a procedure, and in some cases the cached execution plan, though ran speedy for some parameters ran very inefficiency with other parameters.

    Once I found the troublesome procedure my fix was to view the execution plan and create a few indexes so the same, more efficient cached execution plan was created regardless of parameters used, which worked.

    The first thing you need to do is determine what process is taking the longest to run. You may be able to monitor your processes and see which ones are taking a long time to run and go from there.

    Let me know if you need more details and I can send you some of what we did to find the troublesome procedure then remedy the latency.

    Take care --

    Sam

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply