류짱:Beyond MySelf

SQL server 메모리 / Working set - prviate / Lock pages in Memory 본문

Microsoft/MS SQL

SQL server 메모리 / Working set - prviate / Lock pages in Memory

リュちゃん 2011. 4. 7. 10:37

최근 SQL 관련 이슈들이 많습니다. Lock pages in Memory가 설정 되어 있느냐 아니냐에 따라서 SQL server 프로세스의 Working set(작업집합)의 모니터링 결과 값이 완전 달라 지는 현상입니다. 지금까지 잘 모르고 있었던 내용이네요..-___-;

 

[환 경]
Windows Server 2008 R2 / MS SQL Server 2008 + sp2


[문의 사항]
동일 환경의 A 서버와 B서버의 SQL Server 성능 카운터 중 Workingset - Private 의 사용량이 다른 이유?

[증 상]
A 서버의 물리적 메모리는 16G이며 SQL server의 Max Memory를 12G로 설정 한 후 성능 모니터에서
Working set - private을 확인 하면 아래와 같이 SQL sever가 사용하고 있는 현재 메모리 량인 12G의 메모리가 모니터링 됨

그러나 B 서버의 경우 32G의 전체 메모리 중 SQL server의 Max Memory가 26G로 설정 되어 있는데 성능 모니터에서 Working set - Private을 확인하면 약 200M의 메모리를 사용 하는 것으로 확인 됨


[원 인]
Lock pages in memory 권한이 부여되어 있는 경우 아래 카운터로는 SQL Buffer Pool 사이즈를 정확히 모니터링할 수 없습니다.
Lock pages in Memory가 설정 되어 있을 경우에는 Total server Memory 카운터에  Buffer pool에 할당 된 메모리 값이 나타나게 됩니다.

  • The Private Bytes counter and the Working Set counter in Performance Monitor
  • The Mem Usage column on the Processes tab in Task Manager

    How to reduce paging of buffer pool memory in the 64-bit version of SQL Server
    http://support.microsoft.com/kb/918483/en-us

    After you assign the Lock pages in memory user right and you restart the SQL Server service, the buffer pool of the SQL Server process still responds to memory resource notification events, and it dynamically increases or decreases in response to these events. However, you cannot see memory allocations for the buffer pool that are locked in memory in the following performance counters:
    • The Private Bytes counter and the Working Set counter in Performance Monitor
    • The Mem Usage column on the Processes tab in Task Manager

    After these pages are locked, these performance counters represent the memory allocations inside the SQL Server process when those allocations do not use the buffer pool.

    The Total Server Memory(KB) counter of the SQL Server:Memory Manager performance object accurately represents the memory that is allocated for the buffer pool.

     

    또한 SQL Server VAS내에 Reserved 공간과 Committed 된 공간은 DBCC MemoryStatus Memory Manager 항목에서 확인할 수 있습니다.

    http://support.microsoft.com/kb/907877

     

    감사합니다.^^