Lazy Writer Activity

  • Hi all

    In a system with no writes and just selects, lazy writer won't be doing anything at all? Correct?

    In a system like this, which SQL process makes sure that there are free buffers for all the selects?

    Thanks

  • The same process will write dirty pages to disk and free clean pages when they pass the least recently used threshold.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thanks

    The Lazy Writes/Sec counter monitors the amount of dirty pages are moved from to disk. Which counter, if any, measures the total amount of pages, including clean pages moved to disk?

  • Clean pages aren't moved to disk. The only pages that are written back to disk are dirty pages, so the lazy writes/sec measures the total number of pages per sec that the lazy writer writes to disk.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    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
  • Ok - my wording was wrong

    Clean pages can be removed dropped from memory by the lazy writer, based on LRU.

    My question is, I use the lazy writes/sec counter as one of the tools used to monitor memory pressure. I can expect to see this counter do nothing on a system with just selects, correct? So is there a similar counter that shows the amount of clean pages being removed from memory?

    Thanks

  • Primarily as a measure of load you can look at page faults/sec. That will tell you how many times SQL Server had to go looking for pages within memory. You can also read pages in/sec to see how much stuff is getting read from disk.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Just be careful which pages/sec type counter from which object. Many have to do with reads from the page file, which is not what you're looking for.

    I'd monitor the free list stalls/sec to start with. Not by itself though. With all the other usual memory-related counters, maybe with page reads/sec

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    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
  • Thanks Grant and Gail

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

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