add auto fetch ssl certs

This commit is contained in:
2021-08-26 12:11:25 +08:00
parent 11ca254bed
commit 509ac048fc
237 changed files with 4968 additions and 7406 deletions

View File

@@ -13,7 +13,7 @@
"articleSection" : "post",
"name" : "[筆記] postgresql 效能測試 \/ postgresql benchmakr using pgbench",
"headline" : "[筆記] postgresql 效能測試 \/ postgresql benchmakr using pgbench",
"description" : "\x3cp\x3e昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench\x3c\/p\x3e\n\n\x3cp\x3e分數大概如何想要跟他的筆電做個比較\x3c\/p\x3e\n\n\x3cp\x3e之前有跑過幾次這次就順便測試一下不同的硬體配置、以及不同的軟體版本\x3c\/p\x3e\n\n\x3cp\x3e對於pgbench 跑分會有多大的影響\x3c\/p\x3e",
"description" : "\x3cp\x3e昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench\x3c\/p\x3e\n\x3cp\x3e分數大概如何想要跟他的筆電做個比較\x3c\/p\x3e\n\x3cp\x3e之前有跑過幾次這次就順便測試一下不同的硬體配置、以及不同的軟體版本\x3c\/p\x3e\n\x3cp\x3e對於pgbench 跑分會有多大的影響\x3c\/p\x3e",
"inLanguage" : "en",
"author" : "Eric Chang",
"creator" : "Eric Chang",
@@ -45,9 +45,9 @@
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://h.cowbay.org/css/style.css?v=1626744134" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/style.css?v=1629951055" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1626744134" rel="stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1629951055" rel="stylesheet" type='text/css' media='all'>
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
@@ -81,10 +81,6 @@ if (!doNotTrack) {
<ul id="menu-secondary-items" class="menu-secondary-items">
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/"></a>
</li>
<li class="menu-item menu-item-type-taxonomy menu-item-object-category">
<a href="/categories/ansible">ansible</a>
</li>
@@ -309,50 +305,32 @@ if (!doNotTrack) {
<div class="entry-content">
<article>
<p>昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench</p>
<p>分數大概如何,想要跟他的筆電做個比較</p>
<p>之前有跑過幾次,這次就順便測試一下不同的硬體配置、以及不同的軟體版本</p>
<p>對於pgbench 跑分會有多大的影響</p>
<p>OS: ubuntu 18.04.3 x64
postgresql 版本: 10 / 11 / 12
硬碟分成兩種,一個是透過 NFS 10G 網路存取的storage一個是本機三顆硬碟組成的 zfs raidz</p>
<p>大概步驟就是安裝postgresql &amp; tools 然後initialize pgbench table 最後就跑pgbench 測試</p>
<h3 id="install-tools-for-postgresql">install tools for postgresql</h3>
<p>sudo apt install postgresql-contrib</p>
<h3 id="su-to-postgres-and-initialize-pgbench-database">su to postgres and initialize pgbench database</h3>
<p>sudo su - postgres
createdb pgbench
pgbench -i -U postgres -s 10 pgbench</p>
<h3 id="running-the-test">running the test</h3>
<p>pgbench -t 100 -c 100 -S -U postgres pgbench</p>
<p>得出來的結果如下</p>
<p>| | 2 cores / 16G | 4 cores / 16G |
| &mdash; | &mdash; | &mdash; | PGTUNE | NO PGTUNE | PGTUNE | NO PGTUNE |
| PSQL Version | 10G Storage | Local Raidz | 10G Storage | Local Raidz | 10G Storage | Local Raidz | 10G Storage | Local Raidz |
| 10 | 9014.144993 | 9395.847239 | 9508.819462 | 10192.27069 | 13280.99918 | 13819.12767 | 15257.69002 | 15397.53475 |
| 11 | 9418.477212 | 9333.790266 | 9070.990565 | 9071.182748 | 15455.80444 | 16079.6638 | 15710.24677 | 14274.59939 |
| 12 | 8630.21746 | 8872.475173 | 9072.034237 | 9217.547833 | 16116.7502 | 12380.71452 | 17409.10363 | 14520.79393 |</p>
<p>Update: 喵的 Markdown 的表格不支援 colspan ,只好改用圖片方式呈現</p>
<p><img src="https://i.imgur.com/vQFfj6Y.png" alt="'postgresql pgbench banchmark reults'" /></p>
<p><img src="https://i.imgur.com/vQFfj6Y.png" alt="&lsquo;postgresql pgbench banchmark reults&rsquo;"></p>
<p>另外補上一個 2 cores / 2G RAM 的結果</p>
<h3 id="postgresql-10-2g-ram-hdd-on-10g-storage">postgresql 10 , 2G RAM , HDD on 10G Storage</h3>
<h3 id="postgresql-10--2g-ram--hdd-on-10g-storage">postgresql 10 , 2G RAM , HDD on 10G Storage</h3>
<pre><code>postgres@ubuntu:~$ pgbench -t 100 -c 100 -S -U postgres pgbench
starting vacuum...end.
transaction type: &lt;builtin: select only&gt;
@@ -365,45 +343,40 @@ number of transactions actually processed: 10000/10000
latency average = 11.583 ms
tps = 8633.209610 (including connections establishing)
tps = 8651.036900 (excluding connections establishing)
</code></pre>
<p>有幾個地方值得注意</p>
</code></pre><p>有幾個地方值得注意</p>
<ul>
<li><p>記憶體 2G-&gt;16G 效能的增加並沒有很明顯 tps 從 8633 略為上升到 9014</p>
<li>
<p>記憶體 2G-&gt;16G 效能的增加並沒有很明顯 tps 從 8633 略為上升到 9014</p>
<ul>
<li>這個倒是讓我滿意外的一直以來都認為postgresql 非常的需要記憶體,但是實際跑測試卻不是這樣</li>
</ul></li>
<li><p>pgtune 的影響不大,甚至可以說是會降低效能</p>
</ul>
</li>
<li>
<p>pgtune 的影響不大,甚至可以說是會降低效能</p>
<ul>
<li>pgtune 是一個網頁服務可以協助做出「理論上」建議使用的postgresql config
<a href="https://pgtune.leopard.in.ua/#/">https://pgtune.leopard.in.ua/#/</a></li>
<li>從結果可以看出使用pgtune 做出來的config 跟完全使用預設值的config 相比pgtune的效能大部分都略低於預設值</li>
<li>這也讓我很好奇或許要花更多時間去研究postgresql 的config但是我不是 DBA 啊!</li>
</ul></li>
<li><p>CPU 核心數很明顯地影響pgbench</p>
</ul>
</li>
<li>
<p>CPU 核心數很明顯地影響pgbench</p>
<ul>
<li>從表格中可以看到當CPU Cores 增加pgbench的效能也明顯增加</li>
<li><p>而我甚至還沒有指定用多核心去執行測試,如果要用多核心去測試,要把測試指令改成</p>
<li>而我甚至還沒有指定用多核心去執行測試,如果要用多核心去測試,要把測試指令改成</li>
</ul>
<pre><code>pgbench -j 4 -t 100 -c 100 -S -U postgres pgbench
</code></pre></li>
</ul></li>
<li><p>10G Storage和 3顆 2T SATA硬碟組成的 raidz 效能差不多</p>
<li>
<p>10G Storage和 3顆 2T SATA硬碟組成的 raidz 效能差不多</p>
<ul>
<li>如果本機改用 SSD RAID 甚至是 NVME SSD RAID ,效能應該會提高更多</li>
<li>10G的部份最多大概就是略低於 1000MB 左右</li>
<li>如果換成 SSD 效能應該是還會提昇但是有限畢竟10Gb的頻寬限制就在那邊(理論值1250MB左右)</li>
</ul></li>
</ul>
</li>
</ul>
</article>
</div>
@@ -681,7 +654,7 @@ title="pinterest icon"></i>
</ul> <div class="design-credit">
<p>&copy; 2018 Göran Svensson</p>
<p>© 2018 Göran Svensson</p>
<p>Nederburg Hugo Theme by <a href="https://appernetic.io">Appernetic</a>.</p>
@@ -693,7 +666,7 @@ title="pinterest icon"></i>
</div>
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1626744134"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1629951055"></script>
</body>
</html>