软件开发bufferpool

BUFFERpool大小与linux free命令输出之间的关系?

本地新安装虚拟机 linux 设置内存为1G,新安装数据库sample,对数据不做操作,只是不断调大bufferpool(IBMDEFAULTBP 8K),free输出不断变化,最后bufferpool设置为150000已大于内存大小,Swap不断变高。对linux不是很了解。百度一下信息:buffer :作为buffer cache的内存,是块设备的读写...显示全部
本地新安装虚拟机 linux 设置内存为1G,新安装数据库sample,对数据不做操作,只是不断调大bufferpool(IBMDEFAULTBP 8K),free输出不断变化,最后bufferpool设置为150000已大于内存大小,Swap不断变高。

对linux不是很了解。
百度一下信息:

buffer :作为buffer cache的内存,是块设备的读写缓冲区

cache:作为page cache的内存, 文件系统的cache

buffer 与cache 的区别A buffer is something that has yet to be “written” to disk. A cache is something that has been “read” from the disk and stored for later use.
请问:(1)buffers、cached 各是什么意思(不是很理解想在问一下)?(2)调大bufferpool过程中Mem里的buffers值为什么会不断缩小,为什么不是和bufferpool增长成线性缩小?(3)调大bufferpool过程中Mem里的cache为什么会增加?(4)调大bufferpool过程中-/+ buffers/cache里的free为什么会增加?(5)Swap为什么会增加?bufferpool的可以大于内存限制?当bufferpool大于内存时,若果bufferpool空间不释放,占用swap的空间也不会释放么?

(6)从性能角度看,各个参数不断变化能体现什么意思?


bufferpool调整如下:
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 20001
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     938148      74940          0      42232     442460
-/+ buffers/cache:     453456     559632
Swap:      2031608      14688    2016920
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 30001
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     923840      89248          0      17240     462988
-/+ buffers/cache:     443612     569476
Swap:      2031608      26928    2004680
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 40001
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     942156      70932          0      14468     486456
-/+ buffers/cache:     441232     571856
Swap:      2031608      26928    2004680
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 50001
DB20000I  The SQL command completed successfully.

[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     934956      78132          0      14464     547000
-/+ buffers/cache:     373492     639596
Swap:      2031608     132088    1899520
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 70000
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     934392      78696          0      14352     579552
-/+ buffers/cache:     340488     672600
Swap:      2031608     278572    1753036
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 80000
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 80000
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     941568      71520          0      13928     601680
-/+ buffers/cache:     325960     687128
Swap:      2031608     338884    1692724
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 100000
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     942320      70768          0       1172     606504
-/+ buffers/cache:     334644     678444
Swap:      2031608     480148    1551460
[db2inst1@localhost ~]$ db2 alter bufferpool  IBMDEFAULTBP size 150000
DB20000I  The SQL command completed successfully.
[db2inst1@localhost ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1013088     911312     101776          0        504     509428
-/+ buffers/cache:     401380     611708
Swap:      2031608     981264    1050344

附件:

附件图标DB2 内存.pdf (1.2 MB)

收起
参与19

查看其它 14 个回答33lyl的回答

33lyl33lyl数据库管理员榕基软件
关注一下这个问题,我也比较感兴趣
互联网服务 · 2013-11-07
浏览684

回答者

33lyl
数据库管理员榕基软件

33lyl 最近回答过的问题

回答状态

  • 发布时间:2013-11-07
  • 关注会员:2 人
  • 回答浏览:684
  • X社区推广