ITPub博客

首页 > Linux操作系统 > Linux操作系统 > why Buffer Cache Hit Ratio < 0

why Buffer Cache Hit Ratio < 0

原创 Linux操作系统 作者:zhanglei_itput 时间:2009-06-12 17:24:08 0 删除 编辑

  最近一直再研究Buffer Cache Hit Ratio 。有个问题到现在都没有搞清楚,why Buffer Cache Hit Ratio < 0。

    相关解释:
    It is possible for both the 'buffer hit ratio' to be negative.  In the case of the buffer hit ration, the buffer cache is too small and the data in is being aged out before it can be used so it must be retrieved again.  This is a form. of thrashing which degrades performance immensely.

Performance Tuning Guide 10g Release 2 (10.2)
B14211-03

Calculating the Buffer Cache Hit Ratio
The buffer cache hit ratio calculates how often a requested block has been found in the buffer cache without requiring disk access. This ratio is computed using data selected from the dynamic performance view V$SYSSTAT.

consistent gets from cache: Number of times a consistent read was requested for a block from the buffer cache.
db block gets from cache: Number of times a CURRENT block was requested from the buffer cache.
physical reads cache: Total number of data blocks read from disk into buffer cache.

SELECT NAME, VALUE
FROM V$SYSSTAT
WHERE NAME IN ('db block gets from cache', 'consistent gets from cache', 'physical reads cache');
Using the values in the output of the query, calculate the hit ratio for the buffer cache with the following formula:
1 - (('physical reads cache') / ('consistent gets from cache' + 'db block gets from cache')
Buffer Pool Hit Ratios
The data in V$SYSSTAT reflects the logical and physical reads for all buffer pools (by setting
  the BUFFER_POOL_KEEP or BUFFER_POOL_RECYCLE init.ora parameters)
within one set of statistics. To determine the hit ratio for the buffer pools individually, query the V$BUFFER_POOL_STATISTICS view. This view maintains statistics for each pool on the number of logical reads and writes.
The buffer pool hit ratio can be determined using the following formula:
1 - (physical_reads/(db_block_gets + consistent_gets))
The ratio can be calculated with the following query:
SELECT NAME, PHYSICAL_READS, DB_BLOCK_GETS, CONSISTENT_GETS,
1 - (PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS)) "Hit Ratio"
FROM V$BUFFER_POOL_STATISTICS;

在什么情况下用V$SYSSTAT?什么情况下用V$BUFFER_POOL_STATISTICS?为什么Buffer Pool Hit Ratios<0?

参考文献:
  Subject:  STATISTIC "cache hit ratio" - Reference Note
  Doc ID:  33883.1 Type:  REFERENCE
  Modified Date :  12-FEB-2004 Status:  PUBLISHED

  三思笔记
  http://junsansi.itpub.net/post/29894/291051


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9252210/viewspace-606087/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-02-10

  • 博文量
    400
  • 访问量
    1111813