bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

PostgreSQLDBA(96)-SystemConf(client_min_messages)

PostgreSQL提供了參數(shù)client_min_messages用以控制返回給客戶的消息級別,不同的級別返回的消息大小不同,默認(rèn)為NOTICE。在通常情況下,如果客戶端執(zhí)行的SQL語句不頻繁的話,使用默認(rèn)參數(shù)即可,但如果客戶端執(zhí)行大量的SQL,設(shè)置該參數(shù)為較高級別就顯得有意義了:可以減少消息的大小從而降低網(wǎng)絡(luò)負(fù)載,提升吞吐。

東平網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),東平網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為東平1000多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個售后服務(wù)好的東平做網(wǎng)站的公司定做!

參數(shù)簡介
下面創(chuàng)建一個存儲過程,raise notice顯示通知信息

[local]:5432 pg12@testdb=# CREATE OR REPLACE FUNCTION foo() RETURNS void AS
pg12@testdb-# $$
pg12@testdb$#         BEGIN
pg12@testdb$#                 RAISE NOTICE 'some message';
pg12@testdb$#                 RETURN;
pg12@testdb$#         END;
pg12@testdb$# $$ LANGUAGE 'plpgsql';
CREATE FUNCTION
Time: 389.227 ms
[local]:5432 pg12@testdb=#

執(zhí)行存儲過程

[local]:5432 pg12@testdb=# show client_min_messages;
 client_min_messages 
---------------------
 notice
(1 row)
Time: 0.589 ms
[local]:5432 pg12@testdb=# select foo();
NOTICE:  some message
 foo 
-----
(1 row)
Time: 26.838 ms
[local]:5432 pg12@testdb=# set client_min_messages='ERROR';
SET
Time: 0.361 ms
[local]:5432 pg12@testdb=# select foo();
 foo 
-----
(1 row)
Time: 1.638 ms
[local]:5432 pg12@testdb=#

在client_min_messages設(shè)置為ERROR后,不再顯示NOTICE通知信息。
下面使用benchmarksql壓測工具測試該參數(shù)從NOTICE修改為ERROR后的性能變化。
1.NOTICE

[xdb@localhost run]$ ./runBenchmark.sh props.pg
2019-09-25 12:15:25,434  INFO - Term-00, 
2019-09-25 12:15:25,435  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:15:25,435  INFO - Term-00,      BenchmarkSQL v4.1.1
2019-09-25 12:15:25,435  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:15:25,435  INFO - Term-00,  (c) 2003, Raul Barbosa
2019-09-25 12:15:25,435  INFO - Term-00,  (c) 2004-2016, Denis Lussier
2019-09-25 12:15:25,435  INFO - Term-00,  (c) 2016, Jan Wieck
2019-09-25 12:15:25,435  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:15:25,435  INFO - Term-00, 
2019-09-25 12:15:25,435  INFO - Term-00, driver=org.postgresql.Driver
2019-09-25 12:15:25,435  INFO - Term-00, conn=jdbc:postgresql://192.168.26.28:5432/benchmarkdb
2019-09-25 12:15:25,435  INFO - Term-00, user=pg12
2019-09-25 12:15:25,435  INFO - Term-00, 
2019-09-25 12:15:25,435  INFO - Term-00, warehouses=32
2019-09-25 12:15:25,435  INFO - Term-00, terminals=20
2019-09-25 12:15:25,435  INFO - Term-00, runMins=5
2019-09-25 12:15:25,435  INFO - Term-00, limitTxnsPerMin=0
2019-09-25 12:15:25,435  INFO - Term-00, 
2019-09-25 12:15:25,435  INFO - Term-00, newOrderWeight=45
2019-09-25 12:15:25,435  INFO - Term-00, paymentWeight=43
2019-09-25 12:15:25,435  INFO - Term-00, orderStatusWeight=4       Term-00, Running Average 
2019-09-25 12:20:25,706  INFO - Term-00, 52216    Memory Usage: 26MB / 37MB                 
2019-09-25 12:20:25,706  INFO - Term-00,                                                    
2019-09-25 12:20:25,707  INFO - Term-00, Measured tpmC (NewOrders) = 7448.89                
2019-09-25 12:20:25,707  INFO - Term-00, Measured tpmTOTAL = 16626.58                       
2019-09-25 12:20:25,707  INFO - Term-00, Session Start     = 2019-09-25 12:15:25
2019-09-25 12:20:25,707  INFO - Term-00, Session End       = 2019-09-25 12:20:25
2019-09-25 12:20:25,707  INFO - Term-00, Transaction Count = 83171
[xdb@localhost run]$ 
[xdb@localhost run]$

2.ERROR

[xdb@localhost run]$ ./runBenchmark.sh props.pg
2019-09-25 12:22:57,954  INFO - Term-00, 
2019-09-25 12:22:57,954  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:22:57,954  INFO - Term-00,      BenchmarkSQL v4.1.1
2019-09-25 12:22:57,954  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:22:57,954  INFO - Term-00,  (c) 2003, Raul Barbosa
2019-09-25 12:22:57,955  INFO - Term-00,  (c) 2004-2016, Denis Lussier
2019-09-25 12:22:57,955  INFO - Term-00,  (c) 2016, Jan Wieck
2019-09-25 12:22:57,955  INFO - Term-00, +-------------------------------------------------------------+
2019-09-25 12:22:57,955  INFO - Term-00, 
2019-09-25 12:22:57,955  INFO - Term-00, driver=org.postgresql.Driver
2019-09-25 12:22:57,955  INFO - Term-00, conn=jdbc:postgresql://192.168.26.28:5432/benchmarkdb
2019-09-25 12:22:57,955  INFO - Term-00, user=pg12
2019-09-25 12:22:57,955  INFO - Term-00, 
2019-09-25 12:22:57,955  INFO - Term-00, warehouses=32
2019-09-25 12:22:57,955  INFO - Term-00, terminals=20
2019-09-25 12:22:57,955  INFO - Term-00, runMins=5
2019-09-25 12:22:57,955  INFO - Term-00, limitTxnsPerMin=0
2019-09-25 12:22:57,955  INFO - Term-00, 
2019-09-25 12:22:57,955  INFO - Term-00, newOrderWeight=45
2019-09-25 12:22:57,955  INFO - Term-00, paymentWeight=43
2019-09-25 12:22:57,955  INFO - Term-00, orderStatusWeight=4       Term-00, Running Average 
2019-09-25 12:27:58,267  INFO - Term-00, 79156    Memory Usage: 18MB / 37MB                 
2019-09-25 12:27:58,267  INFO - Term-00,                                                    
2019-09-25 12:27:58,267  INFO - Term-00, Measured tpmC (NewOrders) = 7815.72                
2019-09-25 12:27:58,267  INFO - Term-00, Measured tpmTOTAL = 17440.12                       
2019-09-25 12:27:58,267  INFO - Term-00, Session Start     = 2019-09-25 12:22:58
2019-09-25 12:27:58,267  INFO - Term-00, Session End       = 2019-09-25 12:27:58
2019-09-25 12:27:58,268  INFO - Term-00, Transaction Count = 87254
[xdb@localhost run]$

TPMC 7815 vs 7448,提升比例為4.9%

為免系統(tǒng)隨機擾動導(dǎo)致的誤差,重新測試了一遍

-- NONE
2019-09-25 14:53:05,384  INFO - Term-00, Measured tpmC (NewOrders) = 7168.43                
2019-09-25 14:53:05,384  INFO - Term-00, Measured tpmTOTAL = 15890.5                        
2019-09-25 14:53:05,384  INFO - Term-00, Session Start     = 2019-09-25 14:48:05
2019-09-25 14:53:05,385  INFO - Term-00, Session End       = 2019-09-25 14:53:05
2019-09-25 14:53:05,385  INFO - Term-00, Transaction Count = 79491
[xdb@localhost run]$ 
-- vacuum full;
-- client_min_messages=error
2019-09-25 14:44:29,101  INFO - Term-00, Measured tpmC (NewOrders) = 7239.02                
2019-09-25 14:44:29,101  INFO - Term-00, Measured tpmTOTAL = 16079.06                       
2019-09-25 14:44:29,101  INFO - Term-00, Session Start     = 2019-09-25 14:39:28
2019-09-25 14:44:29,102  INFO - Term-00, Session End       = 2019-09-25 14:44:29
2019-09-25 14:44:29,102  INFO - Term-00, Transaction Count = 80434
-- vacuum full;
-- update_process_title=off
-- track_activities=off
2019-09-25 15:01:11,861  INFO - Term-00, Measured tpmC (NewOrders) = 7253.43                
2019-09-25 15:01:11,861  INFO - Term-00, Measured tpmTOTAL = 16111.73                       
2019-09-25 15:01:11,862  INFO - Term-00, Session Start     = 2019-09-25 14:56:11
2019-09-25 15:01:11,862  INFO - Term-00, Session End       = 2019-09-25 15:01:11
2019-09-25 15:01:11,862  INFO - Term-00, Transaction Count = 80584
-- vacuum full;
-- client_min_messages=error
-- update_process_title=off
-- track_activities=off
2019-09-25 15:08:46,923  INFO - Term-00, Measured tpmC (NewOrders) = 7194.55                
2019-09-25 15:08:46,923  INFO - Term-00, Measured tpmTOTAL = 16059.38                       
2019-09-25 15:08:46,923  INFO - Term-00, Session Start     = 2019-09-25 15:03:46
2019-09-25 15:08:46,923  INFO - Term-00, Session End       = 2019-09-25 15:08:46
2019-09-25 15:08:46,923  INFO - Term-00, Transaction Count = 80350

似乎沒有什么效果。

參考資料
Reducing log messages on the client

當(dāng)前名稱:PostgreSQLDBA(96)-SystemConf(client_min_messages)
標(biāo)題路徑:http://vcdvsql.cn/article44/pehihe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化微信小程序網(wǎng)站策劃軟件開發(fā)域名注冊網(wǎng)站設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)