feat: 添加大页内存配置功能,更新相关安装脚本
All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in -34s
Build and Release / build-and-test (amd64, alpine) (push) Successful in -37s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in -21s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in -25s
Build and Release / release (push) Successful in 16s
All checks were successful
Build and Release / build-and-test (arm64, alpine) (push) Successful in -34s
Build and Release / build-and-test (amd64, alpine) (push) Successful in -37s
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in -21s
Build and Release / build-and-test (amd64, ubuntu) (push) Successful in -25s
Build and Release / release (push) Successful in 16s
This commit is contained in:
2
debian/xxxigcc-daemon.service
vendored
2
debian/xxxigcc-daemon.service
vendored
@@ -33,6 +33,8 @@ SyslogIdentifier=xxxigcc-daemon
|
||||
|
||||
# 资源限制
|
||||
LimitNOFILE=65535
|
||||
LimitMEMLOCK=infinity
|
||||
AmbientCapabilities=CAP_IPC_LOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -101,6 +101,16 @@ configure_cpu_rx() {
|
||||
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() {
|
||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||
@@ -137,6 +147,7 @@ replace_config() {
|
||||
|
||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
configure_cpu_rx
|
||||
configure_hugepages
|
||||
}
|
||||
|
||||
show_usage() {
|
||||
|
||||
@@ -108,6 +108,16 @@ configure_cpu_rx() {
|
||||
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() {
|
||||
[[ ! -f "$CONFIG_FILE" ]] && error "配置文件缺失"
|
||||
@@ -144,6 +154,7 @@ replace_config() {
|
||||
|
||||
jq "$jq_cmd" "$CONFIG_FILE" >"$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
|
||||
configure_cpu_rx
|
||||
configure_hugepages
|
||||
}
|
||||
|
||||
# 创建并启动服务
|
||||
|
||||
Reference in New Issue
Block a user