• Informix IDS 11零碎办理(918检验)认证指南,第 3 局部: 弊端诊断(3)


    onstat 适用次序


    onstat 是一个强大的适用次序,可以用来认识弊端诊断所需的种种信息,包罗内存运用状况、收集运用状况、会话流动、缓冲池运用状况和磁盘运用状况。在本节中,评论争持如何运用 onstat 检修这些方面的弊端。


    内存运用状况

    有几个号令可以跟踪内存运用状况:

    onstat -g mem

    执行 onstat -g mem 号令会提供内存中差异池的内存运用状况。

    清单 1. onstat -g mem 的输入

                        
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:28:21
     -- 39936 Kbytes
    Pool Summary:
    afpool       V     10ad28040        8192             2488             5	         3
    tpcpool      V     10b034040        40960            4776             32	         3
    seqpool      V     10b06a040        4096             768              2           1
    pnlpool      V     10b037040        77824            4344             69	         5
    sbtlist      V     10ae10040        20480            7232             4	         3
    dstpool      V     10b033040        8192             3320             2	         2
    sqcrypto     V     10b21b040        4096             504              2           1
    ampool       V     10b061040        8192             3088             22	         1
    Blkpool Summary:
    name         >

    表 1 描述了池的摘要信息。

    表 1. 池摘要信息描述
    称号 描述
    Name 池称号
    > 共享内存类(R=Resident,V=Virtual)
    Addr 池的头内存地点
    size 池的总大小(以字节为单位)
    Freesize 池中的空闲内存
    #allocfrag 分配的内存段数目
    #freefrag 空闲的内存段数目

    表 2. Blkpool 摘要信息描述
    称号 描述
    Name 池称号
    > 共享内存类(R=Resident,V=Virtual)
    Addr 池的头内存地点
    size 池的总大小(以字节为单位)
    #blksize 池中的块数目

    onstat -g ses

    onstat -g ses 可以显示一个会话的内存运用状况。这对付寻觅内存透露等标题结果非常等闲,若是执行 onstat -g ses -r,发明内存分配络续增长,但是内存运用量并未增长,那么很可以是出现了内存透露。

    我们先看看日常的输入:

    清单 2. onstat -g ses 的输入

                        
    $  onstat -g ses
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:52:52
     -- 39936 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    35       informix -        0        -        0        12288      11592      off
    18       informix -        0        -        1        425984     338128     off
    17       informix -        0        -        1        434176     337408     off
    16       informix -        0        -        1        282624     227560     off
    5        informix -        0        -        0        12288      11592      off
    3        informix -        0        -        0        16384      13176      off
    2        informix -        0        -        0        12288      11592      off
    35	informix -        0        -        0        81920	 76360	   off
    


    最次要的局部是总内存和运用的内存。但是,可以对某个会话 id 运用 onstat -g ses 进一步盘诘内存运用状况。

    清单 3. 针对某个会话的 onstat -g ses 的输入

                        
    $ onstat -g ses 35
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:55:28 
    -- 39936 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    35       informix 53       15046    ryleh    1        81920      76360      off
    tid      name     rstcb            flags    curstk   status
    59       sqlexec  10afaa7d0        Y--P---  7791     cond wait(sm_read)
    Memory pools    count 2
    name         >

    onstat -g afr

    onstat -g afr 选项显示一个指定的会话或共享内存池的已分配内存段。每个会话城市失失一个共享内存池。

    这个号令可以用来认识分配了哪个内存池。比喻,若是在反复运转这个号令(onstat -g afr -r)时,发明 ralloc 池络续增长,就可以找到了内存增长偏激的内存池。

    清单 4. onstat -g afr 的输入

                        
    $ onstat -g afr 35
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 02:12:18 
    -- 39936 Kbytes
    Allocations for pool name 35:
    addr             size       memid
    10bf99000        3256       overhead
    10bf99cb8        80         scb
    10bf99d08        64         scb
    1bf99d48         64         ostcb
    10bf99d88        552        opentable
    10bf99fb0        80         osenv
    10bf63000        6856       sqscb
    10bf64ac8        64         sqscb
    10bf64b08        72         sql
    10bf64b50        72         filetable
    10bf64b98        80         fragman
    10bf64be8        80         sqscb
    10bf64c38        64         sqscb
    .
    .
    .
    .
    .
    .
    10bf57f78        136        fragman
    10c071000        2744       ralloc
    10c071ab8        1024       ralloc
    10c073000        2168       buft_buffer
    



    表 3. 列描述
    输入 描述
    addr 池段的内存地点
    size 池段的大小(以字节为单位)
    memid 池段的内存 ID

    onstat -g ffr

    afr 近似的一个选项是 ffr,它显示一个共享内存池的空闲段。

    清单 5. onstat -g ffr 的输入

                        
    $ onstat -g ffr 35
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 02:15:57
     -- 39936 Kbytes
    Free lists for pool name 35:
    addr             size        idx
    10c073878        1928        1
    10bf9ba40        104         11
    10c071eb8        328         39
    10bf9cdd8        552         66
    10bf548a8        1808        99
    



    表 4. 列描述
    输入 描述
    addr 池段的内存地点
    size 池段的大小(以字节为单位)

    检修内存弊端

    假定零碎办理员告诉您,IDS 占用了太多的内存,而且内存运用量还在络续增长。若是您比来没有修纠正任何设置,那么首先要查明的是,能否有任何会话占用了少量内存。

    清单 6. onstat -g ses 的输入

                        
    $  onstat -g ses
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:52:52
     -- 39936 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    35       informix -        0        -        0        12288      11592      off
    18       informix -        0        -        1        425984     338128     off
    17       informix -        0        -        1        434176     337408     off
    .
    .
    .
    2        informix -        0        -        0        12288      11592      off
    2301     bad_app  -        0        -        1      3203072      16384 	   off
    8220     bad_app  -        0        -        1      3194880      16384 	   off
    1704     bad_app  -        0        -        1      3203072      16384 	   off
    430      bad_app  -        0        -        1     19169280      16384 	   off
    1991     bad_app  -        0        -        1      3203072      16384 	   off
    


    可以发明,有一个运用次序只运用大约 16KB 的内存,但是(至多在一个会话中)已经分配了赶过 1 GB 的内存。

    我们进一步看看这个会话。

    清单 7. onstat -g ses | grep 430 的输入

                        
    430      bad_app  -        0        -        1     19202048      16384 	    off
    


    啊!它依然在增长。看来这里出现了内存透露。而今,可以打德律风给您的开辟人员,询问他们修改了什么器材。





    回页首



    收集运用状况

    onstat -g nta

    运用 onstat -g nta 显示来自 -g ntd-g ntm-g ntt-g ntu 的组合收集统计数据。若是装置了 MaxConnect,就可以运用这个号令提供的统计数据举行 MaxConnect 性能调优。

    onstat -g ntd

    onstat -g ntd 显示全局收集信息:

    清单 8. onstat -g ntd 的输入

                        
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:00:44 
    -- 38912 Kbytes
    global network information:
    #netscb connects     read    write    q-free  q-limits  q-exceed alloc/max
    6/   6        1        8        8    0/   0  135/  10    0/   0    1/   1
    Client Type     Calls   Accepted   Rejected       Read      Write
    sqlexec         yes            1          0          7          8
    srvinfx         yes            0          0          0          0
    onspace         yes            0          0          0          0
    onlog           yes            0          0          0          0
    onparam         yes            0          0          0          0
    oncheck         yes            0          0          0          0
    onload          yes            0          0          0          0
    onunload        yes            0          0          0          0
    onmonitor       yes            0          0          0          0
    dr_accept       yes            0          0          0          0
    cdraccept       no             0          0          0          0
    ontape          yes            0          0          0          0
    srvstat         yes            0          0          0          0
    asfecho         yes            0          0          0          0
    listener        yes            0          0          1          0
    crsamexec       yes            0          0          0          0
    onutil          yes            0          0          0          0
    safe            yes            0          0          0          0
    drdaexec        no             0          0          0          0
    smx             yes            0          0          0          0
    Totals                         1          0          8          8
    


    onstat -g ntm

    onstat -g ntm 显示收集邮件统计数据。

    清单 9. onstat -g ntm 的输入

                        
    $ onstat -g ntm
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:03:35 
    -- 38912 Kbytes
    global network information:
    #netscb connects     read    write    q-free  q-limits  q-exceed alloc/max
    6/   6        1        8        8    0/   0  135/  10    0/   0    1/   1
    Network mailbox information:
    box           netscb thread name     max received   in box   max in box full signal
    5        10b239928 tlitcppoll       10        4        0        2        0	yes
    6        10b250928 tlitcplst        10        0        0        0        0	no
    


    onstat -g ntm

    onstat -g ntm 显示无缺的收集光阴。

    清单 10. onstat -g ntm 的输入

                        
    $ onstat -g ntt
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:04:55
     -- 38912 Kbytes
    global network information:
    #netscb connects     read    write    q-free  q-limits  q-exceed alloc/max
    6/   6        1        8        8    0/   0  135/  10    0/   0    1/   1
    Individual thread network information (times):
       netscb thread name    sid     open     read    write address
    10b4bf368 sqlexec          4 07:34:44 07:34:55 07:34:55
    10c10ccd0                 17 07:34:28
    10b270790                 16 07:34:28
    10b3abd18                 15 07:34:28
    10b250928 tlitcplst        3 07:34:22 07:34:44          ryleh|1537|tlitcp
    10b239928 tlitcppoll       2 07:34:22
    


    注意,输入在 write address 列中提供了少量信息。它提供来自 sqlhosts 文件的效力器 | 端口 | 和谈组合。若是有多个监听器线程的话,这些信息有助于跟踪标题结果。

    onstat -g ntu

    onstat -g ntu 显示收集用户统计数据。

    清单 11. onstat -g ntu 的输入

                        
    $ onstat -g ntu
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:08:28 
    -- 38912 Kbytes
    global network information:
    #netscb connects     read    write    q-free  q-limits  q-exceed alloc/max
    6/   6        1        8        8    0/   0  135/  10    0/   0    1/   1
    Individual thread network information (basic):
    netscb type   thread name    sid   fd poll    reads   writes q-nrm q-pvt q-exp
    10b4bf368 tlitcp sqlexec          4    2    5        8        8  0/ 1  1/1  0/ 0
    10c10ccd0 tlitcp unknown         17    0    0        0        0  0/ 0  0/ 0  0/ 0
    10b270790 tlitcp unknown         16    0    0        0        0  0/ 0  0/0  0/ 0
    10b3abd18 tlitcp unknown         15    0    0        0        0  0/ 0  0/ 0  0/ 0
    10b250928 tlitcp tlitcplst        3    1    5        1        0  0/ 0  0/0  0/ 0
    10b239928 tlitcp tlitcppoll       2    0    5        7        0  0/ 0  0/0/ 0
    


    检修收集弊端

    假定您作为 DBA 接到了用户的德律风,他们说他们无法跟尾收集了。

    看看在线日记,没发明什么异常行为。以是,运转 onstat -g nta 看看能否有任何正常景象。

    清单 12. onstat -g nta 的输入

                        
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 01:16:37 -- 389
    12 Kbytes
    global network information:
      #netscb connects     read    write    q-free  q-limits  q-exceed alloc/max
       6/   7       15      936      714    1/   1  135/  10    0/   0    1/   1
    Individual thread network information (basic):
              netscb type   thread name    sid   fd poll    reads   writes q-nrm q-p
    vt q-exp
           10b434b88 tlitcp unknown         19    0    0        0        0  0/ 0  0/
     0  0/ 0
           10b294848 tlitcp unknown         18    0    0        0        0  0/ 0  0/
     0  0/ 0
           10b270ae0 tlitcp unknown         17    0    0        0        0  0/ 0  0/
     0  0/ 0
           10b274928 tlitcp tlitcplst        4    2    5        0        0  0/ 0  0/
     0  0/ 0
           10b250928 tlitcp tlitcplst        3    1    5       15        0  0/ 0  0/
     0  0/ 0
           10b239928 tlitcp tlitcppoll       2    0    5      936        0  0/ 0  0/
     0  0/ 0
           10b239928 tlitcp tlitcppoll       2    0    5      936        0  0/ 0  0/
     0  0/ 0
    Individual thread network information (times):
              netscb thread name    sid     open     read    write address
           10b434b88                 19 09:54:00
           10b294848                 18 09:54:00
           10b270ae0                 17 09:54:00
           10b274928 tlitcplst        4 09:53:54 10:04:03          ryleh|1538|tlitcp
           10b250928 tlitcplst        3 09:53:54 11:54:38          ryleh|1537|tlitcp
           10b239928 tlitcppoll       2 09:53:54
    Network mailbox information:
     box           netscb thread name     max received   in box   max in box full si
    gnal
       5        10b239928 tlitcppoll       10       49        0        4        0
    gnal
       5        10b239928 tlitcppoll       10       49        0        4        0
     yes
       6        10b250928 tlitcplst        10        0        0        0        0
      no
       7        10b274928 tlitcplst        10        0        0        0        0
      no
    Client Type     Calls   Accepted   Rejected       Read      Write
    sqlexec         yes           15          0        921        714
    srvinfx         yes            0          0          0          0
    onspace         yes            0          0          0          0
    onlog           yes            0          0          0          0
    onparam         yes            0          0          0          0
    oncheck         yes            0          0          0          0
    onload          yes            0          0          0          0
    onunload        yes            0          0          0          0
    onmonitor       yes            0          0          0          0
    dr_accept       yes            0          0          0          0
    cdraccept       no             0          0          0          0
    ontape          yes            0          0          0          0
    srvstat         yes            0          0          0          0
    asfecho         yes            0          0          0          0
    listener        yes            0          0         15          0
    onunload        yes            0          0          0          0
    onmonitor       yes            0          0          0          0
    dr_accept       yes            0          0          0          0
    cdraccept       no             0          0          0          0
    ontape          yes            0          0          0          0
    srvstat         yes            0          0          0          0
    asfecho         yes            0          0          0          0
    listener        yes            0          0         15          0
    crsamexec       yes            0          0          0          0
    onutil          yes            0          0          0          0
    safe            yes            0          0          0          0
    drdaexec        no             0          0          0          0
    smx             yes            0          0          0          0
    Totals                        15          0        936        714
    No MaxConnect instances connected
    IO statistics for each MaxConnect instance:
       IMCid    header      data   partial   blocked      data   partial   blocked
                 reads     reads     reads     reads    writes    writes    writes
           -         -         -         -         -         -         -         -
    


    onstat -g ntm 的输入(邮箱)中可以发明,个中一个监听器线程很长光阴没有举行任何读操作了。

    颠末查抄 sqlhosts 文件的第一列中对应的纪录,从而将邮箱与特定的端口/DBSERVERALIAS 组合团结起来。

    来自 onstat -g ntm 的一行

                        
           10b274928 tlitcplst        4 09:53:54 10:04:03          ryleh|1538|tlitcp
           				


    来自 sqlhosts 的一行

                        
    demo_alias	ontlitcp	ryleh	1538
    				


    来自 ONCONFIG 的一行

                               	
    DBSERVERALIASES	demo_alias			
    				


    以是在消耗情况中,便捷的摒挡方案是将用户切换到另一个 DBSERVERALIAS 或 DBSERVERNAME。探求标题结果标本源超过了本教程的局限。





    回页首



    会话流动

    onstat -g ses

    不带会话 id 运转 onstat -g ses,就会为零碎被骗前流动的每个会话生成一行汇总信息。

    正如后面提到的,这个号令非常有助于寻觅客户机运用次序中的内存透露。

    可以运用 -r 选项运转这个号令(onstat -g ses -r ),从而观测在运用的内存总量坚持波动的状况下,总内存能否络续增长。

    清单 13. onstat -g ses 的输入

                        
    $ onstat -g ses
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:14:47 
    -- 38912 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    18       informix -        0        -        0        12288      11592      off
    17       informix -        0        -        1        303104     260672     off
    16       informix -        0        -        1        307200     265480     off
    15       informix -        0        -        1        278528     227640     off
    4        informix 53       25457    ryleh    1        98304      91928      off
    3        informix -        0        -        0        16384      13176      off
    2        informix -        0        -        0        12288      11592      off
    


    在输入中,可以看到运用次序过程的 pid、它拥有的线程数目和总内存。

    要想认识某个会话的更多信息,可以运用 onstat -g ses 以及特定会话 id:

    清单 14. 指定了会话 id 的 onstat -g ses 输入

                        
    $ onstat -g ses 35
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:55:28
     -- 39936 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    35       informix 53       15046    ryleh    1        81920      76360      off
    tid      name     rstcb            flags    curstk   status
    59       sqlexec  10afaa7d0        Y--P---  7791     cond wait(sm_read)
    Memory pools    count 2
    name         >

    可以看到,这里提供了关于这个会话的少量信息,包罗断绝级别、当前的 SQL 语句、前端版本以及后面评论争持过的内存运用状况。

    要注意一下 rstcb。这对应于 onstat -u 输入中的第一列。

    会话级弊端诊断

    假定在摒挡了这个 DBSREVERALIAS 标题结果之后,依然有位用户诉苦说,他的运用次序依然没回声反响(他的用户名是 bad_user)。

    清单 15. onstat -g ses | grep bad_user 的输入

                        
    2257        bad_user -        0        -        0        122288      121592      off
    				


    这里没有什么不正常的景象。运用的内存非常靠近分配的内存。我们运用 onstat -g ses 看看这个用户在做什么:

    清单 16. 指定了会话 id 的 onstat -g ses 输入

                        
    $ onstat -g ses 35
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 2 days 01:55:28
     -- 39936 Kbytes
    session                                      #RSAM    total      used       dynamic
    id       user     tty      pid      hostname threads  memory     memory     explain
    2257     bad_user        15098      ryleh    1        122288      121592     off
    tid      name     rstcb            flags    curstk   status
    2070     sqlexec  10afaa7d0        Y--P---  7791     cond wait(sm_read)
    Memory pools    count 2
    name         >

    这是一个重大的拔出操作。但是先等等。我们看看线程的标志和状况。

    标志是 Y--P---。查阅手册发明,这个线程正在执行某个前提。从线程的状况可以查明这个前提是 cond_wait(smread)。

    以是,您而今要求这位用户注意看看客户机运用次序,由于 sqlexec 正在守候客户机运用次序告诉它应该做什么。





    回页首



    缓冲池运用状况

    onstat -p

    onstat -p 可以用来反省缓冲池的运用状况:

    清单 17. onstat -p 的输入

                        
    $ onstat -p
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:17:03 
    -- 3812 Kbytes
    Profile
    dskreads pagreads bufreads �ched dskwrits pagwrits bufwrits �ched
    933      961      101742   99.08   173      441      6221     97.22
    isamtot  open     start    read     write    rewrite  delete   commit     rollbk
    19993    1533     2346     6077     685      37       346      807	 0
    gp_read    gp_write   gp_rewrt   gp_del     gp_alloc   gp_free    gp_curs
    0          0          0          0          0          0          0
    ovlock     ovuserthread ovbuff     usercpu  syscpu   numckpts   flushes
    0          0            0          3.55     0.52     2          2
    bufwaits lokwaits lockreqs deadlks  dltouts  ckpwaits compress seq scans
    240      0        9130     0        0        0        385      137 0
    ixda-RA    idx-RA     da-RA      RA-pgsused lchwaits
    38         5          162        203        3
    


    首先要看看 ovbuff。ovbuff 是引擎用光缓冲区的次数。若是 ovbuff 正在增长,那么可以思索增长缓冲池的大小。

    注意:SMI 表 sysprofile 中也包罗相同的信息。

    onstat -F

    onstat -F 用来失失执行的种种写操作的计数。

    清单 18. onstat -F 的输入

                        
    $ onstat -F
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:20:45 
    -- 38912 Kbytes
    Fg Writes     LRU Writes    Chunk Writes
    0             0             98
    address           flusher  state    data     # LRU    Chunk    Wakeups  Idle Time
    10afa5820        0        I        0        0        1        1239     1237.670
    states: Exit Idle Chunk Lru
    


    若是 Fg 写操作正在增长,那么可以思索举行调优。

    onstat -R

    onstat -R 用来看管 LRU 行列。对付每个行列,onstat -R 列出行列中的缓冲区数目,以及已经修改的缓冲区的数目和百分比。

    清单 19. onstat -R 的输入

                        
    $ onstat -R
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:30:51
     -- 3812 Kbytes
    Buffer pool page size: 2048
    8 buffer LRU queue pairs              priority levels
    # f/m   pair total     % of    length       LOW      HIGH
    0 F        624     100.0%      624        624          0
    1 m                  0.0%        0          0          0
    2 f        625     100.0%      625        625          0
    3 m                  0.0%        0          0          0
    4 f        626     100.0%      626        626          0
    5 m                  0.0%        0          0          0
    6 f        625     100.0%      625        625          0
    7 m                  0.0%        0          0          0
    8 f        625     100.0%      625        625          0
    9 m                  0.0%        0          0          0
    10 f        625     100.0%      625        625          0
    11 m                  0.0%        0          0          0
    12 f        625     100.0%      625        625          0
    13 m                  0.0%        0          0          0>
    14 f        625     100.0%      625        625          0
    15 m                  0.0%        0          0          0
    0 dirty, 5000 queued, 5000 total, 8192 hash buckets, 2048 buffer size
    start clean at  60.000% (of pair total) dirty, or 374 buffs dirty, stop at
     50.000%
    				



    表 5. 输入声明
    列 描述
    Buffer pool page size 缓冲池的页面大小(以字节为单位)
    # 显示行列号。每个 LRU 行列由两个子行列构成:一个 FLRU 行列和一个 MLRU 行列。(FLRU 和 MLRU 行列的界说见 IBM Informix 办理员指南共享内存一章中有关 LRU 行列的内容。)行列 0 和 1 属于第一个 LRU 行列,行列 2 和 3 属于第二个 LRU 行列,以此类推。
    f/m 标识行列类型:这个字段有四个可以的值:
    f —— 空闲的 LRU 行列。在这个上下文中,空闲意味着未修改。即便 LRU 行列中的几乎完好缓冲区都是可用的,但是数据库效力器会检验考试运用 FLRU 行列(而不是 MLRU 行列)中的缓冲区。(修纠正的缓冲区必须先写到磁盘上,然后数据库效力器才华运用这个缓冲区。)
    F —— 具有最多量元素的空闲 LRU。数据库效力器运用该估测值决意将未修改的(空闲)缓冲区放在那里。
    m —— MLRU 行列
    M —— 刷新器正在举行清理的 MLRU 行列

    length 跟踪行列的长度(缓冲区数目)
    % of 显示子行列占 LRU 行列的百分比。
    比喻,假定一个 LRU 行列中有 50 个缓冲区,个中 30 个缓冲区属于 MLRU 行列,20 个属于 FLRU 行列,那么 % of 列会分辨列出 60.00 和 40.00。
    pair total 提供这个 LRU 行列中缓冲区的总数。
    priority levels 显示优先级:LOW、MED_LOW、MED_HIGH、HIGH

    各个 LRU 行列的信息反面是摘要信息。对摘要信息的注释如下:

    表 6. 输入声明
    列 描述
    dirty 完好 LRU 行列中已经修改的缓冲区的总数
    queued LRU 行列中的缓冲区总数
    total 缓冲区总数
    hash buckets 散列桶的数目
    buffer size 每个缓冲区的大小
    start clean LRU_MAX_DIRTY 的值
    stop at LRU_MIN_DIRTY 的值
    priority downgrades 降到较低优先级的 LRU 行列数目
    priority upgrades 升到较高优先级的 LRU 行列数目

    检修缓冲区弊端

    假定您是一位 DBA,有效户告诉说性能正在降低。

    反省能否有性能瓶颈的体式格局之一是查抄 onstat -p 的输入。只运转这个号令一次可以是缺乏的,由于它只提供一个快照。但是,可以运用 -r 选项,反省能否有什么器材招致了性能降落。

    清单 20. onstat -pr 的输入片段

                        
    $ onstat -pr
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:17:03 
    -- 3812 Kbytes
    Profile
    dskreads pagreads bufreads �ched dskwrits pagwrits bufwrits �ched
    2007     1000     201742   99.08   173      441      6221     97.22
    isamtot  open     start    read     write    rewrite  delete   commit     rollbk
    19993    1533     2346     6077     685      37       346      807	 0
    gp_read    gp_write   gp_rewrt   gp_del     gp_alloc   gp_free    gp_curs
    0          0          0          0          0          0          0
    ovlock     ovuserthread ovbuff     usercpu  syscpu   numckpts   flushes
    0          0            0          3.53     0.52     2          2
    bufwaits lokwaits lockreqs deadlks  dltouts  ckpwaits compress seq scans
    2400      0        9130     0        0        0        385      137 0
    ixda-RA    idx-RA     da-RA      RA-pgsused lchwaits
    38         5          162        203        3
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:17:03
    -- 3812 Kbytes
    Profile
    dskreads pagreads bufreads �ched dskwrits pagwrits bufwrits �ched
    2100     1005      203742   99.08   173      441      6221     97.22
    isamtot  open     start    read     write    rewrite  delete   commit     rollbk
    19993    1533     2346     6077     685      37       346      807	 0
    gp_read    gp_write   gp_rewrt   gp_del     gp_alloc   gp_free    gp_curs
    0          0          0          0          0          0          0
    ovlock     ovuserthread ovbuff     usercpu  syscpu   numckpts   flushes
    0          0            0          3.55     0.54     2          2
    bufwaits lokwaits lockreqs deadlks  dltouts  ckpwaits compress seq scans
    2706      0        9130     0        0        0        385      137 0
    ixda-RA    idx-RA     da-RA      RA-pgsused lchwaits
    38         5          162        203        3
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:17:03
    -- 3812 Kbytes
    Profile
    dskreads pagreads bufreads �ched dskwrits pagwrits bufwrits �ched
    2103      1020      206641   99.08   173      441      6221     97.22
    isamtot  open     start    read     write    rewrite  delete   commit     rollbk
    19993    1533     2346     6077     685      37       346      807	 0
    gp_read    gp_write   gp_rewrt   gp_del     gp_alloc   gp_free    gp_curs
    0          0          0          0          0          0          0
    ovlock     ovuserthread ovbuff     usercpu  syscpu   numckpts   flushes
    0          0            0          3.57     0.54     2          2
    bufwaits lokwaits lockreqs deadlks  dltouts  ckpwaits compress seq scans
    3002      0        9130     0        0        0        385      137 0
    ixda-RA    idx-RA     da-RA      RA-pgsused lchwaits
    38         5          162        203        3
    


    从清单 10 可以看出,bufwaits 增长得非常快。肯定有某个(或某些)页面是热的。

    进一步探求有两种体式格局。我集体喜欢颠末查抄 onstat -X 的输入,认识哪个缓冲区是热缓冲区。onstat -X 会显示缓冲区存守信息。

    清单 21. onstat -X 的输入

                        
    $ onstat -X
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 01:38:47 -- 389
    12 Kbytes
    Buffers (Access)
    address          owner            flags pagenum          memaddr          nslots
    10a21ede0        0                103  11:5893         10a627800        9
    pgflgs scount   waiter
    80e    90     	10afa5028
     		10afa5820
     		10afa6028
     		.
     		.
     		.
     		10afaa028
    Buffer pool page size: 2048
     200 modified, 5000 total, 8192 hash buckets, 2048 buffer size
    


    可以发明个中一个页面有许多人都试图接见会面。而今工作变得复杂了,将页面映射到 onstat -u/onstat -g ses 级别,认识这个页面的内容以及运用它的状况。

    在 pgflags 输入中有一个重大线索。0x80e 意味着这个页面来自一个大块,而且它是一个 blob 位图页面。

    waiter 和 owner 列对应于 onstat -u 输入中的第一列。





    回页首



    磁盘运用状况

    onstat -d

    onstat -d 显示 dbspace 和块的磁盘运用状况。

    清单 22. onstat -d 的输入

                        
     onstat -d
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:39:25 
    -- 3812 Kbytes
    Dbspaces
    address       number   flags    fchunk   nchunks  pgsize   flags    owner	    name
    10aedee78     1        0x40001  1        1        2048     N  B     informix rootdbs
    1 active, 2047 maximum
    Chunks
    address   chunk/dbs offset size  free   bpages  flags  pathname
    10aedf028 1     1   0      15000 1238   PO-B           /testing/prod/1110FC1B5/SERVER
                                                           /chunks/rootchunk
    1 active, 32766 maximum
    


    注意:DBspace 块的 “size” 和 “free” 列中的值是依据它们所属的 DBspace 的 “pgsize” 显示的。

    扩展块容量形式:always。

    表 7. 块输入的次要信息
    列 描述
    Size 块大小(即在线页面数目)
    Free 这个块中的空闲在线页面数目

    onstat -D

    onstat -donstat -D 号令非常近似。

    清单 23. onstat -D 的输入

                        
    $ onstat -D
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 00:42:00 
    -- 38912 Kbytes
    Dbspaces
    address      number   flags     fchunk   nchunks  pgsize   flags   owner     name
    10aedee78    1        0x40001   1        1        2048     N  B    informix  rootdbs
    1 active, 2047 maximum
    Chunks
    address      chunk/dbs  offset    page Rd  page Wr  pathname
    10aedf028    1     1    0         964      492      /testing/prod/1110FC1B5/SERVER/
    					      chunks/rootchunk
    1 active, 32766 maximum
    


    注意: DBspace 块的 “page Rd” 和 “page Wr” 列中的值是依据零碎根底页面大小显示。

    扩展块容量形式:always。

    这里没有显示块的大小,而是显示每个块的读写页面的数目。

    可以颠末反复执行这个号令,在块级看管 I/O。与在分区级看管 I/O(onstat -P)比拟,这种反省的粒度缺乏细。但这是在高层看管 I/O 流动的好体式格局。

    onstat -g iof

    onstat -g iof 选项显示对每个块的读/写数目。若是一个块的 I/O 流动不成比例,这个块就可以是零碎瓶颈。这个选项可以用来看管针对分段表的差异段的 I/O 苦求漫衍状况。

    清单 24. onstat -g iof 的输入

                        
    $ onstat -g iof
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 01:21:55 
    -- 38912 Kbytes
    AIO global files:
    gfd pathname         bytes read     page reads  bytes write    page writes io/s
    3   rootchunk        2697216        1317        2418688        1181        224.8
    op type     count          avg. time
    seeks       0              N/A
    reads       904            0.0010
    writes      454            0.0112
    kaio_reads  0              N/A
    kaio_writes 0              N/A
    


    onstat -g iob

    onstat -g iob 选项显示大缓冲区运用摘要。

    onstat -g iov

    onstat -g iov 选项显示每个编造处置惩罚器的异步 I/O 统计数据。

    onstat -g ioa

    onstat -g ioa 在输入中组合 onstat -g iobonstat -g iofonstat -g iov 的信息。

    磁盘弊端诊断

    磁盘弊端诊断是性能调优方面的次要使命。通常某个过程(好比装载和批处置惩罚过程)日常消耗特定的光阴,但是由于某种启事长光阴无法完成。

    假定一个用户打德律风说,他正在更新一个表中的几百万行,他想晓得为什么要花这么长光阴。

    探求标题结果启事的一种体式格局是在块级查抄流动。

    清单 25. onstat -Dr 的输入片段

                        
    IBM Informix Dynamic Server Version 11.10.FB5TL -- On-Line -- Up 06:23:43 -- 389
    12 Kbytes
    Dbspaces
    address      number   flags      fchunk   nchunks  pgsize   flags   owner     name
    10aeded78	    1	    0x40001    1        1        2048     N B     informix  rootdbs
    .
    .
    10aedee88    2        0x40001    12       1        2048     N B     informix  datadbs
    .
    .
    10aedee98	    3        0x40001    17       1        2048     N B     informix  idxdbs
     1 active, 2047 maximum
    Chunks
    address      chunk/dbs  offset     page Rd  page Wr   pathname
    10aedf028    12     2   0          157000   42790     /dev/chunks/datachunk
    .
    .
    .
    10aeee038	    17	  3   0	        223414   1324123  /dev/chunks/indexdbschunk
     1 active, 32766 maximum
    NOTE: The values in the "page Rd" and "page Wr" columns for DBspace chunks
          are displayed in terms of system base  page size.
    Expanded chunk capacity mode: always
    Note: Due to space constraints, I am just including the relevant chunk information
    Chunks
    address          chunk/dbs  offset     page Rd  page Wr  pathname
    10aedf028        12     2    0         157000     42790  /dev/chunksdatadbschunk
    .
    .
    10aeee038	 17	3    0	 	223414 	 1324123  /dev/chunks/indexdbschunk
    .
    .
    Chunks
    address          chunk/dbs  offset     page Rd  page Wr  pathname
    10aedf028        12     2    0         157103    50320  /dev/chunksdatadbschunk
    .
    .
    .
    10aeee038	 17	3    0	 	343413 	 1924131  /dev/chunks/indexdbschunk
    .
    .
    address          chunk/dbs  offset     page Rd  page Wr  pathname
    10aedf028        12     2    0         157195     51020  /dev/chunksdatadbschunk
    .
    .
    .
    10aeee038	 17	3    0	 	386616 	2242207  /dev/chunks/indexdbschunk
    


    在输入中可以看到,尽管对 datadbs dbspace 的加添并不黑白常快,但是 idxdbs 非常忙。

    idxdbs 为什么会这么忙呢?而今可以运转复杂的 dbschema,反省用户能否对这个表运用了索引。若是有的话,复杂的摒挡方案是禁用索引,在所有更新之后再从新启用它们。



    版权声明: 原创作品,同意转载,转载时请务必以超链接体式格局标明文章 原始来由 、作者信息和本声明。否则将追查法律责任。

  • 相关阅读:
    Android x86 镜像分析之四
    Android x86 镜像分析之三
    Android x86 镜像分析之二
    Android x86镜像分析
    tizen镜像制作
    完成登录与注册页面的前端
    JavaScript 基础,登录前端验证
    CSS实例:图片导航块
    导航,头部,CSS基础
    web基础,用html元素制作web页面
  • 原文地址:https://www.cnblogs.com/zgqjymx/p/1973040.html
Copyright © 2020-2023  润新知