移除大页内存配置函数,简化安装脚本
This commit is contained in:
@@ -101,16 +101,6 @@ configure_cpu_rx() {
|
|||||||
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 配置大页内存
|
|
||||||
configure_hugepages() {
|
|
||||||
if [[ "$one_gb_pages" == "true" ]]; then
|
|
||||||
log "$BLUE" "配置 大页内存..."
|
|
||||||
sysctl -w vm.nr_hugepages=3072
|
|
||||||
echo "vm.nr_hugepages=3072" >>/etc/sysctl.conf
|
|
||||||
log "$GREEN" "大页内存配置完成"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# 更新配置文件
|
# 更新配置文件
|
||||||
replace_config() {
|
replace_config() {
|
||||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||||
@@ -147,7 +137,6 @@ replace_config() {
|
|||||||
|
|
||||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||||
configure_cpu_rx
|
configure_cpu_rx
|
||||||
configure_hugepages
|
|
||||||
}
|
}
|
||||||
|
|
||||||
show_usage() {
|
show_usage() {
|
||||||
|
|||||||
@@ -108,16 +108,6 @@ configure_cpu_rx() {
|
|||||||
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
jq ".cpu.$field = [ $rx_array ]" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 配置大页内存
|
|
||||||
configure_hugepages() {
|
|
||||||
if [[ "$one_gb_pages" == "true" ]]; then
|
|
||||||
log "$BLUE" "配置 大页内存..."
|
|
||||||
sysctl -w vm.nr_hugepages=3072
|
|
||||||
echo "vm.nr_hugepages=3072" >>/etc/sysctl.conf
|
|
||||||
log "$GREEN" "大页内存配置完成"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# 更新配置文件
|
# 更新配置文件
|
||||||
replace_config() {
|
replace_config() {
|
||||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||||
@@ -154,7 +144,6 @@ replace_config() {
|
|||||||
|
|
||||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||||
configure_cpu_rx
|
configure_cpu_rx
|
||||||
configure_hugepages
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 创建并启动服务
|
# 创建并启动服务
|
||||||
|
|||||||
Reference in New Issue
Block a user