From 00f5301b532aa3d75ccdfe2f7023db2f405bf8e0 Mon Sep 17 00:00:00 2001 From: yunlongg <504072751@qq.com> Date: Thu, 16 Jun 2022 18:14:22 +0800 Subject: [PATCH] update parameter script --- .../7-recommended-parameter-settings.md | 13 ++++++++----- .../7-recommended-parameter-settings.md | 13 ++++++++----- .../7-recommended-parameter-settings.md | 13 ++++++++----- .../7-recommended-parameter-settings.md | 13 ++++++++----- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md index 29a86dab..c0215a90 100644 --- a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md +++ b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md @@ -20,8 +20,11 @@ After installing the database, it is recommended to execute the following shell source ~/.bashrc -memory=`free|awk '{print $2}' |sed -n 2p` -if [[ $memory -le 4*1024*1024 ]] +memory=`free -g |awk '{print $2}' |sed -n 2p` +if [[ $memory -le 2 ]] +then + exit 0 +elif [[ $memory -gt 2 ]] && [[ $memory -le 4 ]] then max_process_memory=2GB shared_buffers=128MB @@ -29,7 +32,7 @@ then work_mem=4MB maintenance_work_mem=256MB echo "If the database fails to start, lower the parameters max_process_memory and shared_buffers" -elif [[ $memory -gt 4*1024*1024 ]] && [[ $memory -le 8*1024*1024 ]] +elif [[ $memory -gt 4 ]] && [[ $memory -le 8 ]] then max_process_memory=5GB shared_buffers=1GB @@ -37,8 +40,8 @@ then work_mem=16MB maintenance_work_mem=1GB else - max_process_memory=$((memory*6/10/1024/1024))GB - shared_buffers=$((memory*3/10/1024/1024))GB + max_process_memory=$((memory*6/10))GB + shared_buffers=$((memory*3/10))GB max_connections=3000 work_mem=64MB maintenance_work_mem=2GB diff --git a/product/en/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md b/product/en/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md index e506e34f..20c89931 100644 --- a/product/en/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md +++ b/product/en/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md @@ -20,8 +20,11 @@ After installing the database, it is recommended to execute the following shell source ~/.bashrc -memory=`free|awk '{print $2}' |sed -n 2p` -if [[ $memory -le 4*1024*1024 ]] +memory=`free -g |awk '{print $2}' |sed -n 2p` +if [[ $memory -le 2 ]] +then + exit 0 +elif [[ $memory -gt 2 ]] && [[ $memory -le 4 ]] then max_process_memory=2GB shared_buffers=128MB @@ -29,7 +32,7 @@ then work_mem=4MB maintenance_work_mem=256MB echo "If the database fails to start, lower the parameters max_process_memory and shared_buffers" -elif [[ $memory -gt 4*1024*1024 ]] && [[ $memory -le 8*1024*1024 ]] +elif [[ $memory -gt 4 ]] && [[ $memory -le 8 ]] then max_process_memory=5GB shared_buffers=1GB @@ -37,8 +40,8 @@ then work_mem=16MB maintenance_work_mem=1GB else - max_process_memory=$((memory*6/10/1024/1024))GB - shared_buffers=$((memory*3/10/1024/1024))GB + max_process_memory=$((memory*6/10))GB + shared_buffers=$((memory*3/10))GB max_connections=3000 work_mem=64MB maintenance_work_mem=2GB diff --git a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md index 38447ea0..314bc8ab 100644 --- a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md +++ b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/7-recommended-parameter-settings.md @@ -20,8 +20,11 @@ date: 2021-06-24 source ~/.bashrc -memory=`free|awk '{print $2}' |sed -n 2p` -if [[ $memory -le 4*1024*1024 ]] +memory=`free -g |awk '{print $2}' |sed -n 2p` +if [[ $memory -le 2 ]] +then + exit 0 +elif [[ $memory -gt 2 ]] && [[ $memory -le 4 ]] then max_process_memory=2GB shared_buffers=128MB @@ -29,7 +32,7 @@ then work_mem=4MB maintenance_work_mem=256MB echo "If the database fails to start, lower the parameters max_process_memory and shared_buffers" -elif [[ $memory -gt 4*1024*1024 ]] && [[ $memory -le 8*1024*1024 ]] +elif [[ $memory -gt 4 ]] && [[ $memory -le 8 ]] then max_process_memory=5GB shared_buffers=1GB @@ -37,8 +40,8 @@ then work_mem=16MB maintenance_work_mem=1GB else - max_process_memory=$((memory*6/10/1024/1024))GB - shared_buffers=$((memory*3/10/1024/1024))GB + max_process_memory=$((memory*6/10))GB + shared_buffers=$((memory*3/10))GB max_connections=3000 work_mem=64MB maintenance_work_mem=2GB diff --git a/product/zh/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md b/product/zh/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md index f9acbc46..8225e6e1 100644 --- a/product/zh/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md +++ b/product/zh/docs-mogdb/v3.0/installation-guide/standard-installation/7-recommended-parameter-settings.md @@ -20,8 +20,11 @@ date: 2021-06-24 source ~/.bashrc -memory=`free|awk '{print $2}' |sed -n 2p` -if [[ $memory -le 4*1024*1024 ]] +memory=`free -g |awk '{print $2}' |sed -n 2p` +if [[ $memory -le 2 ]] +then + exit 0 +elif [[ $memory -gt 2 ]] && [[ $memory -le 4 ]] then max_process_memory=2GB shared_buffers=128MB @@ -29,7 +32,7 @@ then work_mem=4MB maintenance_work_mem=256MB echo "If the database fails to start, lower the parameters max_process_memory and shared_buffers" -elif [[ $memory -gt 4*1024*1024 ]] && [[ $memory -le 8*1024*1024 ]] +elif [[ $memory -gt 4 ]] && [[ $memory -le 8 ]] then max_process_memory=5GB shared_buffers=1GB @@ -37,8 +40,8 @@ then work_mem=16MB maintenance_work_mem=1GB else - max_process_memory=$((memory*6/10/1024/1024))GB - shared_buffers=$((memory*3/10/1024/1024))GB + max_process_memory=$((memory*6/10))GB + shared_buffers=$((memory*3/10))GB max_connections=3000 work_mem=64MB maintenance_work_mem=2GB -- Gitee