Managing Memory


Let us discuss on some on some aspects of performance tuning and optimization of sql queries. The following terms are quiet relevant in this regard. Although we do not always think about these counters unlesss we are seriously having issues with the sql server memory or the performance of a strong query.
Buffer Cache Hit Ratio
 The buffer cache is a syndicate or collection of buffer pages. The data pages occupies the biggest part of the memory and pages are mostly read into this cache. In OLTP systems this counter value should be as high as possible. Ideally, 99 percent in most cases. It is exactly the reverse in OLAP or DW environment where cache requirement although is there but as most of it is bulk data (billions of data records), cache requirement is less. Also frequency of requests coming in can be much lower than e.g. transactions in bank. If Buffer cache hit ratio value is low that means, only a few requests could be served out of the buffer cache, with the rest of the requests being served from disk.
 If this truly happens, then definitely the SQL Server is warming up or the memory requirement of the buffer cache is more than the maximum memory available.
Lazy Writes/Sec
The Lazy writes/sec counter records the number of buffers written each second by the buffer manager's lazy write process. In this process the aged buffers are removed from the memory and the memory is freed up for other usage. The Lazy writes/sec values should consistently be less than 20 for the average system. A dirty, aged buffer is one that has all the changes and should be written to the disk. Higher values on this counter possibly indicate I/O issues or even memory problems.
Page Life Expectancy
 Page Life Expectancy indicates how long a page will stay in the buffer syndicate without being referenced. A low number for this counter means that pages are being removed from the buffer. This lowers the efficiency of the cache and indicates the possibility of memory stress. On reporting systems, as opposed to OLTP systems, this number may remain at a lower value since more data is accessed from reporting systems. A reasonable value to expect to see here is 250 - 300 seconds or more.
 Checkpoint Pages/Sec
 The Checkpoint Pages/sec counter represents the number of pages that are moved to the disk by the checkpoint operation. These numbers should be low e.g. less than 30 per second for most systems. A higher number means more pages are being marked as dirty in the cache. When a page is modified in the memory it gets treated as a dirty page and is written into the disk by the next checkpoint operation. I/O problems might be a result of high values on this counter (which indicates a larger number of writes occurring within the system).


You can refer to the following thread or read more on how to fetch these values/counters

Comments

Popular posts from this blog

Automatic Replenishment ~ Warehouse Management (WM) in SAP

Teradata - Month End Date

Cross Domain Webix Post