ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 关于working sets简单记录

关于working sets简单记录

原创 Linux操作系统 作者:wei-xh 时间:2010-12-31 14:07:35 0 删除 编辑
一个working set由如下内容组成:


1.jpg

其中有我们比较熟悉的lru ,lru-w,ckpt queue.
一个db_block_lru_latche保护一个working set。
一个working sets至少需要包含50个buffers。每个working sets都有特定的一个db_block_lru_latche保护。
例如:如果进程需要同时检测LRU或者LRUW列表时,为获得cache buffers lru chain发生锁存器争用,

这个过程等待latch:cache buffers lru chain等待。
我的测试库中cache buffers lru chain的数量。
sysCRMG>select count(*) from v$latch_children where name ='cache buffers lru chain';
  COUNT(*)
----------
        32

由于buffer cache分为了default,keep,recycle池,default池又分为2,4,8,16,32k的,因此
cache buffers lru chain的最少数量为:default+keep+recycle+5个不同大小数据块尺寸的=8.

看看我的数据库中的lru latch分布:
sysCRMG>select d.blk_size, c.child#, p.bp_name, c.gets, c.sleeps
  2    from x$kcbwds d, v$latch_children c, x$kcbwbpd p
  3   where d.set_latch = c.addr
  4     and d.set_id between p.bp_lo_sid and p.bp_hi_sid
  5   order by c.child#;

  BLK_SIZE     CHILD# BP_NAME                                        GETS     SLEEPS
---------- ---------- ---------------------------------------- ---------- ----------
      8192          1 KEEP                                           2015          0
      8192          2 KEEP                                           2015          0
      8192          3 KEEP                                           2015          0
      8192          4 KEEP                                           2015          0
      8192          5 RECYCLE                                        2015          0
      8192          6 RECYCLE                                        2015          0
      8192          7 RECYCLE                                        2015          0
      8192          8 RECYCLE                                        2015          0
      8192          9 DEFAULT                                    32123658      18974
      8192         10 DEFAULT                                    32060918      18256
      8192         11 DEFAULT                                    25369375       8113
      8192         12 DEFAULT                                    25296528       8008
      2048         13 DEFAULT                                        2015          0
      2048         14 DEFAULT                                        2015          0
      2048         15 DEFAULT                                        2015          0
      2048         16 DEFAULT                                        2015          0
      4096         17 DEFAULT                                        2015          0
      4096         18 DEFAULT                                        2015          0
      4096         19 DEFAULT                                        2015          0
      4096         20 DEFAULT                                        2015          0
      8192         21 DEFAULT                                        2015          0
      8192         22 DEFAULT                                        2015          0
      8192         23 DEFAULT                                        2015          0
      8192         24 DEFAULT                                        2015          0
     16384         25 DEFAULT                                        2015          0
     16384         26 DEFAULT                                        2015          0
     16384         27 DEFAULT                                        2015          0
     16384         28 DEFAULT                                        2015          0
     32768         29 DEFAULT                                        2015          0
     32768         30 DEFAULT                                        2015          0
     32768         31 DEFAULT                                        2015          0
     32768         32 DEFAULT                                        2015          0


GETS>2015的行代表已经使用的latch,我们看到default池用到了4把cache buffers lru chain latch.
因此不难推断,数据库存在四个working sets.看看我的测试库的dbwn的进程有几个。
sysCRMG>show parameter db_w
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_writer_processes                  integer                2


看来我的一个DBWN管理了两个working sets.


2.jpg

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

请登录后发表评论 登录
全部评论
Oracle ACE组成员,DBGeeK用户组发起人。曾在DTCC、ORACLE技术嘉年华、Gdevops等公开场合做过数据库技术专题分享,2017年应Oracle邀请在世界最大的数据库会议OOW上做技术分享。组织翻译了《拨云见日,解密Oracle ASM内核》一书。

注册时间:2009-07-04

  • 博文量
    422
  • 访问量
    2425335