您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“分析PostgreSQL DBA數(shù)據(jù)庫(kù)的性能指標(biāo)變化”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“分析PostgreSQL DBA數(shù)據(jù)庫(kù)的性能指標(biāo)變化”吧!
不同的網(wǎng)絡(luò)環(huán)境(延時(shí))對(duì)數(shù)據(jù)庫(kù)的性能指標(biāo)有很大的影響,下面用tc工具來(lái)模擬增加網(wǎng)絡(luò)延時(shí)來(lái)觀察數(shù)據(jù)庫(kù)的性能指標(biāo)變化.
安裝tc
使用python的封裝工具tcconfig,安裝命令:
pip3 install tcconfig
性能測(cè)試
網(wǎng)絡(luò)無(wú)延時(shí)
[pg12@localhost ~]$ pgbench -S -c 10 -h localhost -T 20 test starting vacuum...end. transaction type: <builtin: select only> 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
網(wǎng)絡(luò)延時(shí)延時(shí)10ms
設(shè)置網(wǎng)絡(luò)延時(shí)為10ms
tcset --device lo --delay=10 --overwrite
再次測(cè)試
[pg12@localhost ~]$ pgbench -S -c 10 -h 192.168.26.28 -T 20 test starting vacuum...end. transaction type: <builtin: select only> 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多,差不多只有原來(lái)的1/40
網(wǎng)絡(luò)延時(shí)50ms
設(shè)置網(wǎng)絡(luò)延時(shí)為50ms
tcset --device lo --delay=50 --overwrite
再次測(cè)試
[pg12@localhost ~]$ pgbench -S -c 10 -h 192.168.26.28 -T 20 test starting vacuum...end. transaction type: <builtin: select only> 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)
這一次結(jié)果是80多,差不多是最初的1/200
為什么OLTP分布式數(shù)據(jù)庫(kù)的TPS的提升是很難的一個(gè)事情,其中一個(gè)原因是網(wǎng)絡(luò)延時(shí).
到此,相信大家對(duì)“分析PostgreSQL DBA數(shù)據(jù)庫(kù)的性能指標(biāo)變化”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。