1. 配置NFS。html
参考(http://www.javashuo.com/article/p-emmatsqb-mu.html) sql
2. 安装benchmarksql。网络
参考(http://www.javashuo.com/article/p-bfrrbenl-k.html)函数
3. 测试FIO。测试
参考(http://www.javashuo.com/article/p-rcdnymhg-m.html).net
主要测试顺序写、顺序读、随机写、随机读。 跑tpcc主要是看顺序写的时延和带宽。htm
4. 模拟网络环境较差状况TC。blog
参考(https://blog.csdn.net/duanbeibei/article/details/41250029/)ip
主要是限制时延、带宽、丢包率。ci
5.最后要使用pg内部的函数来测试读写io。
主要是
pg_stat_get_file_stat和pg_stat_get_redo_stat
一个是总体文件、一个是redolog。
pg_stat_get_file_stat:filenum,dbid,spcid,phyrds,phywrts,phyblkrd,phyblkwrt,readtim,writetim,avgiotim,lstiotim,miniotim,maxiowtm
pg_stat_get_redo_stat:phywrts,phyblkwrt,writetim,avgiotim,lstiotim,miniotim,maxiowtm
拿writetim 除以phywrts 就是每次写操做的时间。 在根据FIO和运行时nmon等监测状况判断瓶颈是哪里、如何调优。