您好,登錄后才能下訂單哦!
本篇內容主要講解“分析PostgreSQL DBA數據庫的性能指標變化”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“分析PostgreSQL DBA數據庫的性能指標變化”吧!
不同的網絡環境(延時)對數據庫的性能指標有很大的影響,下面用tc工具來模擬增加網絡延時來觀察數據庫的性能指標變化.
安裝tc
使用python的封裝工具tcconfig,安裝命令:
pip3 install tcconfig
性能測試
網絡無延時
[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
網絡延時延時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: <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多,差不多只有原來的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: <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)
這一次結果是80多,差不多是最初的1/200
為什么OLTP分布式數據庫的TPS的提升是很難的一個事情,其中一個原因是網絡延時.
到此,相信大家對“分析PostgreSQL DBA數據庫的性能指標變化”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。