From 98b6d79cfeaecc263ce6497db3beac478b2ad850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=90=E7=8B=B8Nomad?= <9463297+callmer@user.noreply.gitee.com> Date: Tue, 6 Dec 2022 07:26:22 +0000 Subject: [PATCH] =?UTF-8?q?update=205.PVE=E5=88=B6=E4=BD=9C=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=9C=BA=E6=A8=A1=E6=9D=BF.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 狐狸Nomad <9463297+callmer@user.noreply.gitee.com> --- 5.PVE制作虚拟机模板.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/5.PVE制作虚拟机模板.md b/5.PVE制作虚拟机模板.md index 4e89999..fd3d5af 100644 --- a/5.PVE制作虚拟机模板.md +++ b/5.PVE制作虚拟机模板.md @@ -213,12 +213,29 @@ sudo systemctl restart dhcpcd.service ### 1.5.调整系统内核参数 -由于该 Debian 虚拟机模板将用于克隆内网 DNS 服务器,因此需要调整一部分系统内核参数来简单优化性能。 +由于该 Debian 虚拟机模板将用于克隆内网 DNS 服务器,因此需要调整一部分系统内核参数来简单优化性能。 -执行以下命令对 `sysctl` 的配置文件进行修改: +使用 `nano` 编辑器创建 **内核模块** 配置文件,执行以下命令: ```bash -## 调整系统内核参数 +## 创建 内核模块 配置文件 +sudo nano /etc/modules-load.d/server_modules.conf +``` + +在编辑器对话框中输入以下内容,并保存: + +```bash +# This configuration file is customized by fox +# Optimize BBR modules at system boot + +tcp_bbr + +``` + +使用 `nano` 编辑器编辑 **内核参数** 配置文件,执行以下命令: + +```bash +## 编辑 内核参数 配置文件 sudo nano /etc/sysctl.d/99-sysctl.conf ``` @@ -238,9 +255,9 @@ net.ipv4.tcp_congestion_control = bbr net.ipv4.conf.all.log_martians = 1 -net.ipv4.icmp_ratelimit = 100 net.ipv4.igmp_max_memberships = 100 +net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 120 net.ipv4.tcp_max_orphans = 4096 @@ -249,6 +266,7 @@ net.ipv4.tcp_syncookies = 1 net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0 + ``` 保存该配置文件后,重启系统或者执行以下命令让配置生效: