你提到的 “Ubuntu Stream8” 可能是 CentOS Stream 8 或 Ubuntu + 某个 Stream 相关组件 的误写。下面我分两种情况说明,并给出通用优化建议。
CentOS Stream 8 是 RHEL 的上游发行版,优化思路偏服务器。
# 更新系统
dnf update -y
# 关闭无用服务
systemctl disable --now firewalld # 若使用云安全组可关
systemctl disable --now postfix
# 时间同步
dnf install -y chrony
systemctl enable --now chronyd
编辑 /etc/sysctl.conf:
net.core.somaxconn = 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 15
vm.swappiness = 10
sysctl -p
/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
Ubuntu 本身没有 “Stream8”,但优化方法通用。
sudo apt update && sudo apt upgrade -y
sudo apt autoremove -y
sudo systemctl disable --now snapd
/etc/sysctl.conf
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
sysctl -p
modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf
noatime你可以告诉我:
我可以给你更精准的一键优化方案。