大量更新

This commit is contained in:
zeaslity
2025-01-22 09:49:04 +08:00
parent a7f691cf7d
commit 20c4f57715
46 changed files with 19954 additions and 31 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# 更新软件包列表
sudo apt update
# 安装 sysctl 工具(如果未安装)
sudo apt install -y procps
# 调整系统参数
cat <<EOF | sudo tee -a /etc/sysctl.d/wdd-kernel.conf
# 增加最大文件描述符数
fs.file-max = 100000
# 调整网络参数
net.core.somaxconn = 1024
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 200000
EOF
# 应用 sysctl 配置
sudo sysctl -p /etc/sysctl.d/wdd-kernel.conf
# 调整用户级别的最大打开文件数
cat <<EOF | sudo tee -a /etc/security/limits.conf
* soft nofile 100000
* hard nofile 100000
EOF
# 重新启动服务以应用更改(如有需要)
# sudo systemctl restart <your-service>
echo "系统参数调整完成,请根据需要重启服务器。"