资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

分析PostgreSQLDBA数据库的性能指标变化

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

成都创新互联公司长期为上千多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为尉犁企业提供专业的网站制作、成都网站设计,尉犁网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

不同的网络环境(延时)对数据库的性能指标有很大的影响,下面用tc工具来模拟增加网络延时来观察数据库的性能指标变化.

安装tc
使用python的封装工具tcconfig,安装命令:

pip3 install tcconfig

性能测试
网络无延时

[pg12@localhost ~]$ pgbench -S -c 10 -h localhost -T 20 test
starting vacuum...end.
transaction type: 
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 20 s
number of transactions actually processed: 298322
latency average = 0.671 ms
tps = 14911.921647 (including connections establishing)
tps = 14916.752171 (excluding connections establishing)

TPS接近15K

网络延时延时10ms
设置网络延时为10ms

tcset --device lo --delay=10 --overwrite

再次测试

[pg12@localhost ~]$ pgbench -S -c 10 -h 192.168.26.28 -T 20 test
starting vacuum...end.
transaction type: 
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 20 s
number of transactions actually processed: 8459
latency average = 23.655 ms
tps = 422.736098 (including connections establishing)
tps = 424.325926 (excluding connections establishing)

TPS直接降至400多,差不多只有原来的1/40

网络延时50ms
设置网络延时为50ms

tcset --device lo --delay=50 --overwrite

再次测试

[pg12@localhost ~]$ pgbench -S -c 10 -h 192.168.26.28 -T 20 test
starting vacuum...end.
transaction type: 
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 20 s
number of transactions actually processed: 1650
latency average = 121.406 ms
tps = 82.368327 (including connections establishing)
tps = 83.671552 (excluding connections establishing)

这一次结果是80多,差不多是最初的1/200

为什么OLTP分布式数据库的TPS的提升是很难的一个事情,其中一个原因是网络延时.

到此,相信大家对“分析PostgreSQL DBA数据库的性能指标变化”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


网站题目:分析PostgreSQLDBA数据库的性能指标变化
标题来源:http://cdkjz.cn/article/gdohsj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220