Linux VPS服务器性能优化命令
1. 基础系统优化1.1 关闭不必要的服务检查并禁用不必要的后台服务,减少资源占用:# 查看正在运行的服务
systemctl list-units --type=service --state=running
# 禁用并停止服务
systemctl disable --now <service-name>常见可关闭服务:cups - 打印服务bluetooth - 蓝牙服务avahi-daemon - Zeroconf/Bonjour服务rpcbind - 旧版NFS服务1.2 系统与软件包更新保持系统最新以确保安全性和性能:# Debian/Ubuntu
apt update && apt upgrade -y && apt autoremove -y
# CentOS/RHEL
yum update -y && yum clean all1.3 启用BBR拥塞控制算法优化TCP网络传输性能:# 配置BBR
cat >> /etc/sysctl.conf <<EOF
net.core.defau