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 29a86dabe8510406c0d422d1a395cb2345d50733..c0215a90ef45e70edba9deeb1a6832ffca444dcc 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 e506e34fc909c9dc59a42adb5f50dde47e8916bd..20c89931ada60e8e354b7a8d57417040844d2434 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 38447ea065f7c77456bc4dcc8e857adc39ca22cd..314bc8abd2489860bb32cd2a7acbf8f519aa6ba4 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 f9acbc4607fc7983b6fa2233c55107a0fd5815f8..8225e6e1cc44844a413b10c99aba6ce87dffa3bd 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