From 9c4e17982633a8c4bad0c9db8c52fe9f36ffac33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E7=8B=90=E7=8B=B8?= Date: Sat, 6 Aug 2022 13:25:13 +0000 Subject: [PATCH] =?UTF-8?q?update=204.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 --- 4.PVE制作虚拟机模板.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/4.PVE制作虚拟机模板.md b/4.PVE制作虚拟机模板.md index 3c10e42..0040acd 100644 --- a/4.PVE制作虚拟机模板.md +++ b/4.PVE制作虚拟机模板.md @@ -354,3 +354,33 @@ sudo nano /etc/network/interfaces # configuration fragments are stored in /run: # source-directory /run/network/interfaces.d ## 在这行前面增加注释符 # 来注释 ``` + +### 5.4.调整系统内核参数 + +由于该 Debian 虚拟机模板主要作为内网的 DNS 服务器使用,因此调整一部分系统内核参数来简单优化一下性能。 + +使用 `nano` 编辑器编辑 `sysctl` 的配置文件,使用以下命令: + +```bash +## 调整系统内核参数 +sudo nano /etc/sysctl.conf +``` + +在编辑器对话框中输入以下内容,注意命令中间的空格: + +```bash +net.core.default_qdisc = fq_codel +net.ipv4.tcp_congestion_control = bbr + +net.ipv6.conf.all.disable_ipv6 = 1 + +net.ipv4.tcp_fastopen = 1 +net.ipv4.tcp_syncookies = 1 +net.ipv4.tcp_notsent_lowat = 131072 + +net.ipv4.tcp_ecn = 1 +net.ipv4.tcp_sack = 1 +net.ipv4.tcp_dsack = 1 + +net.ipv4.icmp_ratelimit = 50 +``` \ No newline at end of file