VPS 常用脚本

2019年3月12日


加速类

BBR 原版/魔改/plus+锐速 四合一

项目:https://github.com/cx9208/Linux-NetSpeed
bbrplus介绍见:https://www.hostloc.com/thread-507165-1-1.html

wget "https://github.com/chiakge/Linux-NetSpeed/raw/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

提示证书错误的话执行:

apt-get -y install ca-certificates
yum -y install ca-certificates

某些情况下需要执行:

apt-get install libelf-dev

wget --no-check-certificate -q -O bbr2.sh "https://raw.githubusercontent.com/yeyingorg/bbr2.sh/master/bbr2.sh" && chmod +x bbr2.sh && bash bbr2.sh auto

检查 BBR 是否启用

sysctl net.ipv4.tcp_available_congestion_control

如果返回值为:

net.ipv4.tcp_available_congestion_control = bbr cubic reno

只要后面有 bbr,则说明已经开启成功了。

魔改 OpenVZ 开启 GoogleBBR

适用于基于OpenVZ虚拟机上的 Debian or Ubuntu。

单网卡(单 IP) 服务器:

wget https://github.com/tcp-nanqinlang/lkl-rinetd/releases/download/1.1.0/tcp_nanqinlang-rinetd-debianorubuntu.sh
bash tcp_nanqinlang-rinetd-debianorubuntu.sh

多网卡(多 IP) 服务器,会为所有网卡(所有 IP)提供加速:

wget https://github.com/tcp-nanqinlang/lkl-rinetd/releases/download/1.1.0/tcp_nanqinlang-rinetd-debianorubuntu-multiNIC.sh
bash tcp_nanqinlang-rinetd-debianorubuntu-multiNIC.sh

装完后需要重启系统,输入y即可立即重启,或者之后输入reboot命令重启。

性能测试类

superbensh

wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

或者:

wget https://raw.githubusercontent.com/oooldking/script/master/superbench.sh 
chmod +x superbench.sh
./superbench.sh
wget https://raw.githubusercontent.com/oooldking/script/master/superspeed.sh
chmod +x superspeed.sh
./superspeed.sh
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh

英文版:

wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh && bash ZBench.sh

bench

wget  https://raw.githubusercontent.com/sayem314/serverreview-benchmark/master/bench.sh
chmod +x bench.sh
./bench.sh -a share

测实际内存

wget http://down.xxorg.com/Tool/memtest/memtest_1M_64
chmod +x ./memtest_1M_64
./memtest_1M_64
慢读 慢生活

Slow Rhythm of Life.