1.MySQL 5.7内存优化:

1
2
3
4
5
performance_schema_max_table_instances=400  
table_definition_cache=400    
performance_schema=off  
innodb_buffer_pool_chunk_size=64M    
innodb_buffer_pool_size=64M   

2.bbr:

1
2
3
4
echo "net.core.default_qdisc=fq"  >>  /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr"  >>  /etc/sysctl.conf
sysctl -p
lsmod | grep bbr

3.swap的调整:

临时调整vm.swappiness参数为5

1
sudo sysctl vm.swappiness=5

永久调整 vm.swappiness参数为1(优先使用物理内存,迫不得已使用swap)

1
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/vm.sh && chmod +x vm.sh && ./vm.sh

禁用:

1
sudo swapoff -a

4.一键DD:

推荐萌咖脚本

curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/vpsnew.sh && chmod +x vpsnew.sh && ./vpsnew.sh

5.推荐脚本

先安装依赖:

1
apt update -y
1
apt install -y curl

自用:

1
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/tool.sh && chmod +x tool.sh && ./tool.sh

来自科技lion:

1
curl -sS -O https://raw.githubusercontent.com/kejilion/sh/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh