本篇内容主要讲解“pgbench性能测试分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“pgbench性能测试分析”吧!

--pgbench测试性能压力pgbench-i-s2-F80-h192.168.8.81-p5432-Upguser-dmydb--pgbench内置测试脚本如下[postgres@pgtest~]$pgbench-blistAvailablebuiltinscripts:tpcb-likesimple-updateselect-only--tpcb-like包含selectupdateinsert,其他如字面意思,默认为tpcb-likepgbench-bsimple-update-h192.168.8.81-p5432-Upgusermydbstartingvacuum...end.transactiontype:<builtin:simpleupdate>scalingfactor:2querymode:simplenumberofclients:1numberofthreads:1numberoftransactionsperclient:10numberoftransactionsactuallyprocessed:10/10latencyaverage=4.611mstps=216.853874(includingconnectionsestablishing)tps=237.214382(excludingconnectionsestablishing)--混合测试两种方式,28比例混合测试pgbench-bsimple-update@2-bselect-only@8-btpcb@0-h192.168.8.81-p5432-Upgusermydb--可自定义脚本pgbench-fbench_script_for_select.sql-Upgusermydb--可加权重第一个脚本执行3次,第二个执行10次,60秒pgbench-T60-fbench_insert.sql@3-fbench_select.sql@10-Upgusermydb--模拟4个客户端,每个事物创建新的连接-Cpgbench-c4-C-Upgusermydb--每隔两秒输出一次测试结果-P-j多线程pgbench-P2-T7200-c8-j8-fbench_select.sql@10-fupdate.sql@3-Upgusermydb

到此,相信大家对“pgbench性能测试分析”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!