From 9f6a2fe42d603264fe66fdf77c2d3c687933026b Mon Sep 17 00:00:00 2001 From: CallMeR <9463297+callmer@user.noreply.gitee.com> Date: Mon, 1 Dec 2025 13:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20sysctl=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05.PVE制作虚拟机模板.md | 14 +++++++------- 07.PVE制作TS服务器.md | 16 +++++++++------- src/debian/debian_dns_99_sysctl.conf | 14 +++++++------- src/debian/debian_ts_99_sysctl.conf | 16 +++++++++------- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/05.PVE制作虚拟机模板.md b/05.PVE制作虚拟机模板.md index a80490e..037da6a 100644 --- a/05.PVE制作虚拟机模板.md +++ b/05.PVE制作虚拟机模板.md @@ -188,12 +188,12 @@ net.core.default_qdisc = fq_codel # Other adjustable system parameters -net.core.netdev_budget = 600 -net.core.netdev_budget_usecs = 20000 +net.core.netdev_budget = 1200 +net.core.netdev_budget_usecs = 10000 net.core.somaxconn = 8192 -net.core.rmem_max = 26214400 -net.core.wmem_max = 655360 +net.core.rmem_max = 33554432 +net.core.wmem_max = 33554432 net.ipv4.igmp_max_memberships = 256 @@ -201,10 +201,10 @@ net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 120 -net.ipv4.tcp_max_syn_backlog = 512 +net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_notsent_lowat = 131072 -net.ipv4.tcp_rmem = 4096 87380 26214400 -net.ipv4.tcp_wmem = 4096 16384 655360 +net.ipv4.tcp_rmem = 4096 4194304 33554432 +net.ipv4.tcp_wmem = 4096 4194304 33554432 net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0 diff --git a/07.PVE制作TS服务器.md b/07.PVE制作TS服务器.md index ff3e956..a700fb0 100644 --- a/07.PVE制作TS服务器.md +++ b/07.PVE制作TS服务器.md @@ -227,13 +227,13 @@ net.ipv6.conf.default.forwarding = 1 # Other adjustable system parameters -net.core.netdev_budget = 600 -net.core.netdev_budget_usecs = 20000 +net.core.netdev_budget = 1200 +net.core.netdev_budget_usecs = 10000 net.core.rps_sock_flow_entries = 32768 net.core.somaxconn = 8192 -net.core.rmem_max = 536870912 -net.core.wmem_max = 536870912 +net.core.rmem_max = 67108864 +net.core.wmem_max = 67108864 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 @@ -263,10 +263,10 @@ net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 120 -net.ipv4.tcp_max_syn_backlog = 512 +net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_notsent_lowat = 131072 -net.ipv4.tcp_rmem = 8192 262144 536870912 -net.ipv4.tcp_wmem = 4096 16384 536870912 +net.ipv4.tcp_rmem = 8192 4194304 67108864 +net.ipv4.tcp_wmem = 4096 4194304 67108864 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 @@ -278,7 +278,9 @@ net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0 net.netfilter.nf_conntrack_acct = 1 +net.netfilter.nf_conntrack_buckets = 65536 net.netfilter.nf_conntrack_checksum = 0 +net.netfilter.nf_conntrack_max = 262144 net.netfilter.nf_conntrack_tcp_timeout_established = 7440 ``` diff --git a/src/debian/debian_dns_99_sysctl.conf b/src/debian/debian_dns_99_sysctl.conf index 79bb8cc..0b3fe34 100644 --- a/src/debian/debian_dns_99_sysctl.conf +++ b/src/debian/debian_dns_99_sysctl.conf @@ -8,12 +8,12 @@ net.core.default_qdisc = fq_codel # Other adjustable system parameters -net.core.netdev_budget = 600 -net.core.netdev_budget_usecs = 20000 +net.core.netdev_budget = 1200 +net.core.netdev_budget_usecs = 10000 net.core.somaxconn = 8192 -net.core.rmem_max = 26214400 -net.core.wmem_max = 655360 +net.core.rmem_max = 33554432 +net.core.wmem_max = 33554432 net.ipv4.igmp_max_memberships = 256 @@ -21,10 +21,10 @@ net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 120 -net.ipv4.tcp_max_syn_backlog = 512 +net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_notsent_lowat = 131072 -net.ipv4.tcp_rmem = 4096 87380 26214400 -net.ipv4.tcp_wmem = 4096 16384 655360 +net.ipv4.tcp_rmem = 4096 4194304 33554432 +net.ipv4.tcp_wmem = 4096 4194304 33554432 net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0 diff --git a/src/debian/debian_ts_99_sysctl.conf b/src/debian/debian_ts_99_sysctl.conf index ff20023..1efaa80 100644 --- a/src/debian/debian_ts_99_sysctl.conf +++ b/src/debian/debian_ts_99_sysctl.conf @@ -14,13 +14,13 @@ net.ipv6.conf.default.forwarding = 1 # Other adjustable system parameters -net.core.netdev_budget = 600 -net.core.netdev_budget_usecs = 20000 +net.core.netdev_budget = 1200 +net.core.netdev_budget_usecs = 10000 net.core.rps_sock_flow_entries = 32768 net.core.somaxconn = 8192 -net.core.rmem_max = 536870912 -net.core.wmem_max = 536870912 +net.core.rmem_max = 67108864 +net.core.wmem_max = 67108864 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 @@ -50,10 +50,10 @@ net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 120 -net.ipv4.tcp_max_syn_backlog = 512 +net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_notsent_lowat = 131072 -net.ipv4.tcp_rmem = 8192 262144 536870912 -net.ipv4.tcp_wmem = 4096 16384 536870912 +net.ipv4.tcp_rmem = 8192 4194304 67108864 +net.ipv4.tcp_wmem = 4096 4194304 67108864 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 @@ -65,6 +65,8 @@ net.ipv6.conf.all.use_tempaddr = 0 net.ipv6.conf.default.use_tempaddr = 0 net.netfilter.nf_conntrack_acct = 1 +net.netfilter.nf_conntrack_buckets = 65536 net.netfilter.nf_conntrack_checksum = 0 +net.netfilter.nf_conntrack_max = 262144 net.netfilter.nf_conntrack_tcp_timeout_established = 7440