廣州網站制作怎么選百度網站怎么做
文章目錄
- openGauss學習筆記-84 openGauss 數據庫管理-內存優(yōu)化表MOT管理-內存表特性-MOT部署服務器優(yōu)化:x86
- 84.1 BIOS
- 84.2 操作系統(tǒng)環(huán)境設置
- 84.3 網絡
openGauss學習筆記-84 openGauss 數據庫管理-內存優(yōu)化表MOT管理-內存表特性-MOT部署服務器優(yōu)化:x86
通常情況下,數據庫由以下組件綁定:
- CPU:更快的CPU可以加速任何CPU綁定的數據庫。
- 磁盤:高速SSD/NVME可加速任何I/O綁定數據庫。
- 網絡:更快的網絡可以加速任何SQL*Net綁定數據庫。
除以上內容外,以下通用服務器設置默認使用,可能會明顯影響數據庫的性能。
MOT性能調優(yōu)是確??焖俚膽贸绦蚬δ芎蛿祿z索的關鍵步驟。MOT支持最新的硬件,因此調整每個系統(tǒng)以達到最大吞吐量是極為重要的。
以下是用于優(yōu)化在英特爾x86服務器上運行MOT時的建議配置。這些設置是高吞吐量工作負載的最佳選擇。
84.1 BIOS
-
Hyper Threading設置為ON。
強烈建議打開超線程(HT=ON)。
建議在MOT上運行OLTP工作負載時打開超線程。當使用超線程時,某些OLTP工作負載顯示高達40%的性能增益。
84.2 操作系統(tǒng)環(huán)境設置
-
NUMA
禁用NUMA平衡,如下所示。MOT以極其高效的NUMA-aware方式進行內存管理,遠遠超過操作系統(tǒng)使用的默認方法。
echo 0 > /proc/sys/kernel/numa_balancing
-
服務
禁用如下服務:
service irqbalance stop # MANADATORY service sysmonitor stop # OPTIONAL, performance service rsyslog stop # OPTIONAL, performance
-
調優(yōu)服務
以下為必填項。
服務器必須運行throughput-performance配置文件。
[...]$ tuned-adm profile throughput-performance
throughput-performance配置文件是廣泛適用的調優(yōu),它為各種常見服務器工作負載提供卓越的性能。
其他不太適合openGauss和MOT服務器的配置可能會影響MOT的整體性能,包括:平衡配置、桌面配置、延遲性能配置、網絡延遲配置、網絡吞吐量配置和節(jié)能配置。
-
系統(tǒng)命令
推薦使用下列操作系統(tǒng)設置以獲得最佳性能。
-
在/etc/sysctl.conf文件中添加如下配置,然后執(zhí)行sysctl -p命令:
net.ipv4.ip_local_port_range = 9000 65535 kernel.sysrq = 1 kernel.panic_on_oops = 1 kernel.panic = 5 kernel.hung_task_timeout_secs = 3600 kernel.hung_task_panic = 1 vm.oom_dump_tasks = 1 kernel.softlockup_panic = 1 fs.file-max = 640000 kernel.msgmnb = 7000000 kernel.sched_min_granularity_ns = 10000000 kernel.sched_wakeup_granularity_ns = 15000000 kernel.numa_balancing=0 vm.max_map_count = 1048576 net.ipv4.tcp_max_tw_buckets = 10000 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 30 net.ipv4.tcp_keepalive_probes = 9 net.ipv4.tcp_keepalive_intvl = 30 net.ipv4.tcp_retries2 = 80 kernel.sem = 250 6400000 1000 25600 net.core.wmem_max = 21299200 net.core.rmem_max = 21299200 net.core.wmem_default = 21299200 net.core.rmem_default = 21299200 #net.sctp.sctp_mem = 94500000 915000000 927000000 #net.sctp.sctp_rmem = 8192 250000 16777216 #net.sctp.sctp_wmem = 8192 250000 16777216 net.ipv4.tcp_rmem = 8192 250000 16777216 net.ipv4.tcp_wmem = 8192 250000 16777216 net.core.somaxconn = 65535 vm.min_free_kbytes = 26351629 net.core.netdev_max_backlog = 65535 net.ipv4.tcp_max_syn_backlog = 65535 #net.sctp.addip_enable = 0 net.ipv4.tcp_syncookies = 1 vm.overcommit_memory = 0 net.ipv4.tcp_retries1 = 5 net.ipv4.tcp_syn_retries = 5
-
按如下方式修改/etc/security/limits.conf對應部分:
<user> soft nofile 100000 <user> hard nofile 100000
軟限制和硬限制設置可指定一個進程同時打開的文件數量。軟限制可由各自運行這些限制的進程進行更改,直至達到硬限制值。
-
-
磁盤/SSD
下面以數據庫同步提交模式為例,介紹如何保證磁盤讀寫性能適合數據庫同步提交模式。
按如下方式運行磁盤/SSD性能測試:
[...]$ sync; dd if=/dev/zero of=testfile bs=1M count=1024; sync 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 1.36034 s, 789 MB/s
當磁盤帶寬明顯低于789MB/s時,可能會造成openGauss性能瓶頸,尤其是造成MOT性能瓶頸。
84.3 網絡
需要使用10Gbps以上網絡。
運行iperf命令進行驗證:
Server side: iperf -s
Client side: iperf -c <IP>
rc.local:網卡調優(yōu)
以下可選設置對性能有顯著影響:
-
將https://gist.github.com/SaveTheRbtz/8875474下的set_irq_privacy.sh文件拷貝到/var/scripts/目錄下。
-
進入/etc/rc.d/rc.local,執(zhí)行chmod命令,確保在boot時執(zhí)行以下腳本:
'chmod +x /etc/rc.d/rc.local' var/scripts/set_irq_affinity.sh -x all <DEVNAME> ethtool -K <DEVNAME> gro off ethtool -C <DEVNAME> adaptive-rx on adaptive-tx on Replace <DEVNAME> with the network card, i.e. ens5f1
👍 點贊,你的認可是我創(chuàng)作的動力!
?? 收藏,你的青睞是我努力的方向!
?? 評論,你的意見是我進步的財富!