Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90973172
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: DB2/Informix

2008-04-08 16:06:10

出处:Unix爱好者家园unix-cd.com 


 

Onstat -D

INFORMIX-OnLine Version 7.22.UC1 -- On-Line -- Up 00:00:38 -- 423064 Kbytes


Dbspaces

address number flags fchunk nchunks flags owner name

ad5c100 1    1   1   1    N   informix rootdbs

ad5dc28 2    1   2   1    N   informix dbs7

ad5dc98 3    1   3   1    N   informix dbs8

3 active, 2047 maximum

Chunks

address chk/dbs offset page Rd page Wr pathname

ad5c170 1 1   50   1259   289   /dev/pa11

ad5c638 2 2   50   11    11    /dev/pa12

ad5c710 3 3   50   3    0    /dev/pa13

3 active, 2047 maximum 

  

  监视“page Rd”和“Page Wr”列中页读和页写的数目,这样可以检查每个chunk访问的均衡情况。记住一个设备上可能会有多个chunk。

 

Onstat -F

 

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:05:32 -- s


 

Fg Writes  LRU Writes  Chunk Writes

0      602010    355973


address      flusher    state   data

c0000000ba33e828  0       I     0    = 0X0

c0000000ba33f028  1       I     0    = 0X0

c0000000ba33f828  2       I     0    = 0X0

c0000000ba340028  3       I     0    = 0X0

states: Exit Idle Chunk Lru

  监视系统上发生的写操作的种类。前台写(Fg Writes)应该受到限制,LRU写和chunk写会因为系统的不同而不同。

OLTP系统应该减少LRU写,但总会存在chunk写,但是LRU写会减少检查点发生的持续时间。在DSS系统中,chunk写应该大大提高,但仍会发生部分LRU写以限制前台写。在检查点时刻,监视页清除器(刷新器),确保它们都在忙于进行chunk写。

 

onstat -l

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:07:45 -- 4

046800 Kbytes


Physical Logging

Buffer bufused bufsize numpages numwrits pages/io

P-2 452 2000 364787 288 1266.62

phybegin physize phypos phyused %used

102159 500000 321166 480 0.10


Logical Logging

Buffer bufused bufsize numrecs numpages numwrits recs/pages pages/io

L-2 3 1000 11052069 515302 2412 21.4 213.6

Subsystem numrecs Log Space used

OLDRSAM 11052069 1038267280


address number flags uniqid begin size used %used

c00000001807d4c0 4 U-B---- 6724 300035 25000 25000 100.00

c00000001807d4e0 5 U-B---- 6725 3061dd 25000 25000 100.00

c00000001807d500 6 U-B---- 6726 30c385 25000 25000 100.00

c00000001807d520 7 U-B---- 6727 31252d 25000 25000 100.00

c00000001807d540 8 U-B---- 6728 3186d5 25000 25000 100.00

c00000001807d560 9 U-B---- 6729 31e87d 25000 25000 100.00

  监视物理日志缓冲区的使用情况,观察输出第一行中bufsize和pages/io列,如pages/io除以bufsize大约为75%,则可以判定缓冲区的使用效率较高。如果小于75%,则物理日志缓冲区可能太大。如果该比率大于90%。则物理缓冲区太小。

  采取同样的方法,监视逻辑日志缓冲区的使用情况。但如果使用无缓冲区日志,则缓冲区刷新要看事务的大小,而不是缓冲区的使用情况,这一点也可能总是成立。如果大多数事务比逻辑日志缓冲区页小,那么这一比例可能总是不搞,将逻辑缓冲日志保持其默认值。位物理日志文件应该在检查点发生时进行监测,确定该比率是否接近75%。调整良好的物理日志文件在检查点发生时几乎全满,如文件没满,则会浪费磁盘空间。还应该监视逻辑日志文件以确保它们已备份。使用sysmaster数据库,可确定那个逻辑日志文件是空闲的,在sytrans表中查找min(tx_logunip)>0的行,找出包含开放事务的最后哪个逻辑日志文件。

 

onstat -m

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:07:45 -- 4

Message Log File: /informix/online_cqys.log

15:04:02 Checkpoint loguniq 6739, logpos 0x884360


15:09:06 Fuzzy Checkpoint Completed: duration was 0 seconds, 12066 buffers no.

15:09:06 Checkpoint loguniq 6739, logpos 0x1719768


15:14:11 Fuzzy Checkpoint Completed: duration was 2 seconds, 3236 buffers not.

15:14:11 Checkpoint loguniq 6739, logpos 0x36aa018


15:19:14 Fuzzy Checkpoint Completed: duration was 0 seconds, 4645 buffers not.

15:19:14 Checkpoint loguniq 6739, logpos 0x39d8454


15:24:17 Fuzzy Checkpoint Completed: duration was 0 seconds, 5692 buffers not.

15:24:17 Checkpoint loguniq 6739, logpos 0x3bfb06c


15:29:20 Fuzzy Checkpoint Completed: duration was 0 seconds, 6731 buffers not.

15:29:20 Checkpoint loguniq 6739, logpos 0x3df959c


15:34:23 Fuzzy Checkpoint Completed: duration was 0 seconds, 7886 buffers not.

15:34:23 Checkpoint loguniq 6739, logpos 0x403f258

  监视消息文件,查找可能发生的特殊事件。监视检查点发生频率及其运行时间。

 

onstat -P

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:10:41 -- s


Profile

dskreads pagreads bufreads %cached dskwrits pagwrits bufwrits %cached

26059644 31440119 370783723 92.97 1488140 2230274 12930759 88.49


isamtot open start read write rewrite delete commit rollbk

148231940 5204271 7784395 95437285 925906 180816 2501177 160828 21


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 23394.78 14060.69 173 442


bufwaits lokwaits lockreqs deadlks dltouts ckpwaits compress seqscans

3315302 903 1998277520 0 0 254 54700 529618


ixda-RA idx-RA da-RA RA-pgsused lchwaits

334215 1570017 18647872 20544716 204519

 

Profile信息中有许多可以监测的内容

  对OLTP系统来说,缓存读取命中率是十分重要的。读取命中率应大于等于95%。因为应用程序使用数据,这一点不是总能办到的,但这是一个起点,增加更多的缓冲区通常可以增加缓存读取命中率。也要监视缓存写入命中率,但它不太容易调整,缓冲区增加,它也会增加。应该将初始目标定位于85%或更高,但由于应用不同,该比率可能无法达到。锁冲突可以观察locwaits和locreqs两列,如果lockwaits等于或者大于lockreqs的1%,可能会有锁冲突,改变应用程序使用隔离级别和锁的方式将改善锁冲突的发生几率。

  应用中出现死锁可以重deadlks和dltouts列中检查出,deadlks是Online检测并放弃的死锁数,dltouts是超出死锁时间的查询的数目。只有分布式查询才会出现死锁,如发生死锁,则应该改变应用程序。

 

onstat -R

NFORMIX-OnLine Version 7.22.UC1 -- On-Line -- Up 00:44:42 -- 423064 Kbytes


16 buffer LRU queue pairs

# f/m length % of pair total

0 f 188 100.0% 188

1 m 0 0.0%

2 f 188 100.0% 188

3 m 0 0.0%

4 f 188 100.0% 188

5 m 0 0.0%

6 f 188 100.0% 188

7 m 0 0.0%

8 f 188 100.0% 188

9 m 0 0.0%

10 f 188 100.0% 188

11 m 0 0.0%

12 f 188 100.0% 188

13 m 0 0.0%

14 f 188 100.0% 188

15 m 0 0.0%

0 dirty, 3000 queued, 3000 total, 4096 hash buckets, 2048 buffer size 

start clean at 20% (of pair total) dirty, or 37 buffs dirty, stop at 10% 

 

  观察检查点发生时,每个队列中已经修改的缓冲区的百分比。将它和LRU_MAX_DIRTY参数进行比较,它应该总是小于LRU_MAX_DIRTY。若非如此,则可以判断执行写请求的pagecleaner不够,或者AIO VP不够,也可能是执行物理写入的KAIO线索不够,或者磁盘控制器不够或者驱动器本身饱和。对于OLTP系统,减少LRU_MAX_DIRTY,使之小于LRU队列中的dirty页的百分比通常将减少检查点的持续时间。

 

Onstat -g ioq

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:42:23 -- 4

046800 Kbytes


AIO I/O queues:

q name/id len maxlen totalops dskread dskwrite dskcopy

adt 0 0 0 0 0 0 0

msc 0 0 1 27777 0 0 0

aio 0 0 19 320953 274 319581 0

pio 0 0 1 297 0 297 0

lio 0 0 1 2556 0 2556 0

gfd 3 0 16 8251 2248 6003 0

gfd 4 0 1 9 9 0 0

gfd 5 0 1 17441 17441 0 0

gfd 6 0 1 3234 3234 0 0

gfd 7 0 1 1618 1618 0 0

gfd 8 0 18 1000492 476405 524087 0

gfd 9 0 16 13049 2778 10271 0

gfd 10 0 1 3 2 1 0

gfd 11 0 1 3 2 1 0

gfd 12 0 16 8743 8405 338 0

gfd 13 0 118 1735774 1462006 273768 0

gfd 14 0 124 1151165 960630 190535 0

  监视I/O请求队列的长度(len)及其最大长度(maxlen)。maxlen大于25或者len总大于10说明请求没有得到及时的服务。如果磁盘或控制器尚未饱和,那么增加更多的VP将会有所帮助。

 

Onstat -g lsc

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:15:12 -- s


Light Scan Info

descriptor address next_lpage next_ppage ppage_left bufcnt look_e

0 c41edcd0 87 500223 490 1 N

1 c41efe68 85 6000cc 497 1 Y

1 c41f07b8 83 7000cc 497 1 Y


  用onstat -g lsc判定是否使用了轻扫描。如果表大于缓冲区的大小,隔离级别设置为drity读,或者提交读或对表上加上共享锁,则会进行轻扫描。轻扫描会显著加快大表的扫描速度,ppage_left列显示给定表分片上的仍需要扫描的页数。

 

Onstat -g ntd

Informix Dynamic Server 2000 Version 9.21.FC1 -- On-Line -- Up 18:18:29 -- s


global network information:

#netscb connects read write q-free q-limits q-exceed alloc/max

455/ 463 5594 8101338 8197592 8/ 92 135/ 10 0/ 0 461/ 461


Client Type Calls Accepted Rejected Read Write

sqlexec yes 5262 16 7295101 7370232

srvinfx yes 246 0 0 0

onspace yes 0 0 0 0

onlog yes 0 0 0 0

onparam yes 0 0 0 0

oncheck yes 11 0 289615 316253

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 51 0 510917 510969

srvstat yes 24 0 24 48

asfecho yes 0 0 0 0

listener yes 0 0 5606 12

crsamexec yes 0 0 0 0

safe yes 0 0 0 0

onutil yes 0 0 75 78

Totals 5594 16 8101338 8197592

  

  监视接受/拒绝的连接数,如果被拒绝的连接数很大,则表示用户表已经溢出(onstat -p ovuserthreads),或者是连接时网络超时。

 

Onstat -g ppf

INFORMIX-OnLine Version 7.22.UC1 -- On-Line -- Up 9 days 08:06:18 -- 593176 Ks


Partition profiles

partnum lkrqs lkwts dlks touts isrd iswrt isrwt isdel bfrd bfwrt seqsc

23 0 0 0 0 505 11 0 0 0 0 0

24 0 0 0 0 9 0 0 0 0 0 0

25 0 0 0 0 117 108 0 0 0 0 0

28 0 0 0 0 27 0 0 0 0 0 0

1026 0 0 0 0 0 9 0 0 0 0 0

2097164 981899 0 0 0 565034 17143 40936 0 674706 62304 0

2097166 1082441098 0 0 0 540163381 205711 0 208383 541724842 4

6291462 34525 0 0 0 8 0 0 0 88836 18850 0

10485947 39761212 0 0 0 2763355 7732 30897 43 12004155 56154 17

10486038 11793045 0 0 0 1549399 11307 38431 34 5514385 63245 55

  监视使用isrd,iswrt,isrwt,和isdel在打开的分片上进行读写操作的数目,由于只列出了打开的表,因此长时间用onstat -g ppf采样,可以指出有哪些表被频繁使用。用segsc确定从表中读取数据时是否使用了顺序扫描。比较同一表各个分片的情况,判定每个分片的I/O是否均衡。

 
阅读(430) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~