用了 91yun 站长老司机破解的 ServerSpeeder 之后,效果感觉是不错的。有时候,感觉安装过之后感觉比没安装还要慢,我怀疑是不是老司机破解的出问题了,后来想到了配置,对,锐速速度慢 80% 是配置问题,所以呢,我写了这个优化脚本,优化配置,给新手用。
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
clear
echo
echo “#############################################################”
echo “# ServerSpeeder Optimization 1.0 For 91Yun ServerSpeeder #”
echo “# Author: J2S016 233 #”
echo “# Thanks: @91Yun #”
echo “#############################################################”
echo
Get_OS_Bit()
{
if [[ `getconf WORD_BIT` = ’32’ && `getconf LONG_BIT` = ’64’ ]] ; then
OS=’x64′
echo “OS Bit : x64”
else
OS=’x32′
echo “OS Bit : x32”
fi
}
Get_Kernel_Version()
{
Kernel=`uname -r`
echo “Kernel Version : $Kernel”
}
Get_Dist_Name()
{
if grep -Eqi “CentOS” /etc/issue || grep -Eq “CentOS” /etc/*-release; then
DISTRO=’CentOS’
PM=’yum’
elif grep -Eqi “Debian” /etc/issue || grep -Eq “Debian” /etc/*-release; then
DISTRO=’Debian’
PM=’apt-get’
elif grep -Eqi “Ubuntu” /etc/issue || grep -Eq “Ubuntu” /etc/*-release; then
DISTRO=’Ubuntu’
PM=’apt’
else
DISTRO=’unknow’
fi
}
Check_OpenVZ()
{
echo “Checking System Virtualization…”
if [ -f /proc/user_beancounters ] || [ -d /proc/bc ]; then
virtualization=openvz
echo “Virtualization OS : $virtualization”
else
virtualization=kvmxen
echo “Virtualization OS : KVM or Xen”
fi
}
echo “**** Get System Infomation ****”
Get_Dist_Name
Get_OS_Bit
Get_Kernel_Version
Check_OpenVZ
# 外网获取 IP
IP=`curl -s http://members.3322.org/dyndns/getip`;
echo “IP is $IP”
echo “**** System Infomation End****”
echo “System information is correct? The correct return can not correctly please Ctrl+C stop”
read -p
# 目前先这么放着 下面给他强制安装一下 ppp 套件
apt-get install pptpd
# 这里不写系统判断了
yum install -y ppp
cp /serverspeeder/etc/config /serverspeeder/etc/config.bak
sed -i “s/accppp=\”0\”/accppp=\”1\”/g” /serverspeeder/etc/config
# 高级入向加速
sed -i “s/advinacc=”0″\”/advinacc=\”1\”/g” /serverspeeder/etc/config
# 局域网加速 这个有点小必要
sed -i “s/subnetAcc=”0″\”/subnetAcc=\”1\”/g” /serverspeeder/etc/config
# 加速时最高占用的内存以达到效果 ( 极力推荐 )
clear
echo “MEMINFO:”
echo
free -m
echo “Please Input Mem Free:”
echo “For Exmple:”
echo “IF YOUR MEMINFO just like this:”
meminfo233=”
total used free shared buffers cached
Mem: 1002 560 442 0 144 212
”
echo “$meminfo233”
echo “Mem free is 560”
echo “SO , Here in put 550″
memshiji=”512”
read -p “InPUT MEM FREE(default 512): ” memshiji
memserverspeeder2=`echo “$memshiji * 8” | bc`
memserverspeederall=`echo $memshiji $memserverspeeder2`
sed -i “s/l2wQLimit=”256 2048″\”/l2wQLimit=\”$memserverspeederall\”/g” /serverspeeder/etc/config
sed -i “s/w2lQLimit=”256 2048″\”/w2lQLimit=\”$memserverspeederall\”/g” /serverspeeder/etc/config
# 整体速度
sed -i “s/initialCwndWan=”22″\”/initialCwndWan=\”600\”/g” /serverspeeder/etc/config
# 修改完后 保存修改
bash /serverspeeder/bin/serverSpeeder.sh reload
bash /serverspeeder/bin/serverSpeeder.sh restart
echo ” 生效! ”
工具代码量不大,直接开源公布,不希望有任何篡改的行为发生!
这里没有添加 rso 这个修改是因为 91yun 的这个自带这个参数,所以没必要!
使用方法很简单,复制上面代码内容,然后到 VPS 主机上去, ( 这里文件名随意 )vim ./serverspeederot.sh 或 vi ./serverspeederot.sh ,输入 i 添加上面的内容,然后 Esc 退出, :wq! 保存即可
安装说明:
**** Get System Infomation **** 获取系统信息
**** System Infomation End**** 系统信息获取完毕
System information is correct? The correct return can not correctly please Ctrl+C stop 系统信息是否正确,错误的话按 Ctrl+C 停止
MemInfo 这里是很重要的
比如这里 MemInfo 是这样:
total used free shared buffers cached
Mem: 1002 560 442 0 144 212
则下面要 输入 free 下面的那个 560 这个数值
回车即可
剩下的都是自动化处理, 2 分钟搞定锐速问题 ~
csvmode 、 highcsv 这两个参数请自行调整,因为无法判断是否是美国主机,开启了部分主机会降低速度
github挂了
Mem free is 560
SO , Here in put 550
Input MEM FREE : 550
sed: -e expression #1, char 47: unknown option to `s’
(license B4BEA6BA505DC0CB48727829)
生效!
sed: -e expression #1, char 47: unknown option to `s’
请问下如何解决呢?
同问
同问
安装成功
但安装玩之后好像没感觉到加速啊,好像还慢了那么一点点。
美国的VPS,要怎么设置?
根据TCP协议自己慢慢研究配置文件咯…调整是需要有基础的。
好的,现在已经在调整了,谢谢你的回复。
啊。我也觉得变慢了。之前youtu7000多现在就剩3000了,能问下dalao应该怎么下载呢?谢谢。尴尬
线路人多了自然就变慢了,很正常.
嗯, 应该是的。能问下下载代码应该是怎样的,萌新求助。
我那128M 的机子老是死机,所以就想着优化一下配置,结果速度大跌呢,
卸载了重装一遍就好了
嗯,求助下卸载代码。。。。。前面老是打错字。
如果你用的是我的一键包,这里有卸载命令:https://www.91yun.org/archives/683
“#############################################################”
“# ServerSpeeder Optimization 1.0 For 91Yun ServerSpeeder
“# Author: J2S016 233
“# Thanks: @91Yun
“#############################################################”
./serverspeederot.sh: line 16: conditional binary operator expected
./serverspeederot.sh: line 16: syntax error near `WORD_BIT’
./serverspeederot.sh: line 16: `if [[ getconf WORD_BIT = ’32’ && getconf LONG_BIT = ’64’ ]] ; then’
Mem free is 560
SO , Here in put 550
Input MEM FREE(default 512):
./serverspeederot.sh: line 106: *8: syntax error: operand expected (error token is “*8”)
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command
看到了,你得输入,你直接回车他计算不出来数据
Mem free is 560
SO , Here in put 550
Input MEM FREE(default 512):
./serverspeederot.sh: line 106: *8: syntax error: operand expected (error token is “*8”)
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command
请问这是咋回事
输入数字啊,你的如果是512就输入512,default 512意思是锐速自带的是512加速
Mem free is 560
SO , Here in put 550
Input MEM FREE(default 512): 560
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command
sed: can’t read /serverspeeder/etc/config: No such file or directory
bash: /serverspeeder/bin/serverSpeeder.sh: No such file or directory
bash: /serverspeeder/bin/serverSpeeder.sh: No such file or directory
生效!
还是报错,希望你能帮忙。
貌似是锐速的问题,请发issues
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command
sed: can’t read /serverspeeder/etc/config: No such file or directory
bash: /serverspeeder/bin/serverSpeeder.sh: No such file or directory
bash: /serverspeeder/bin/serverSpeeder.sh: No such file or directory
生效!
我的VPS是Vultr,OS是centos 7,节点在日本。家用电信100M。速度从20+KB/S,提升到80KB/S,效果就是这么一个效果
/serverspeeder/etc/config: No such file or directory
/serverspeeder/bin/serverSpeeder.sh: No such file or directory
/serverspeeder/bin/serverSpeeder.sh: No such file or directory
No such file or directory 没有这个文件或者目录
貌似是锐速没有安装好诶
不会装啊,是复制代码到Xshell上执行,还是复制到Winscp的文件夹里,能否说明详细些
食用方法:wget https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh && bash ./serverspeederot.sh
复制这段代码到Xshell里即可!
github链接挂了
填写完free mem后,提示sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command,然后就(license xxxxxxxxxxxxx)生效了。过程对么?
Upload On Github: github.com/JulySnow/91yunserverspeederot
食用方法:wget https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh && bash ./serverspeederot.sh
发现问题及时反馈与我。
麻烦站长帮我加到上面谢谢!
‘: not a valid identifiere 3: export: `PATH
: command not foundh: line 4:
: command not foundh: line 5: clear
: command not foundh: line 6: echo
#############################################################
# ServerSpeeder Optimization 1.0 For 91Yun ServerSpeeder #
# Author: J2S016 233 #
# Thanks: @91Yun #
#############################################################
: command not foundh: line 12: echo
: command not foundh: line 13:
‘/serverspeederot.sh: line 14: syntax error near unexpected token `
‘/serverspeederot.sh: line 14: `Get_OS_Bit()
还是出错,日志:
root@zhlirong:~# wget https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh && bash ./serverspeederot.sh
–2016-10-15 17:50:40– https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 151.101.24.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.24.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 3342 (3.3K) [text/plain]
Saving to: ‘serverspeederot.sh’
100%[======================================>] 3,342 –.-K/s in 0s
Last-modified header missing — time-stamps turned off.
2016-10-15 17:50:40 (34.8 MB/s) – ‘serverspeederot.sh’ saved [3342/3342]
‘: not a valid identifiere 3: export: `PATH
./serverspeederot.sh: line 4: $’\r’: command not found
./serverspeederot.sh: line 5: $’clear\r’: command not found
./serverspeederot.sh: line 6: $’echo\r’: command not found
#############################################################
# ServerSpeeder Optimization 1.0 For 91Yun ServerSpeeder #
# Author: J2S016 233 #
# Thanks: @91Yun #
#############################################################
./serverspeederot.sh: line 12: $’echo\r’: command not found
./serverspeederot.sh: line 13: $’\r’: command not found
./serverspeederot.sh: line 14: syntax error near unexpected token `$’\r”
‘/serverspeederot.sh: line 14: `Get_OS_Bit()
主要出错日子
‘: not a valid identifiere 3: export: `PATH
./serverspeederot.sh: line 4: $’\r’: command not found
./serverspeederot.sh: line 5: $’clear\r’: command not found
./serverspeederot.sh: line 6: $’echo\r’: command not found
./serverspeederot.sh: line 12: $’echo\r’: command not found
./serverspeederot.sh: line 13: $’\r’: command not found
./serverspeederot.sh: line 14: syntax error near unexpected token `$’\r’
‘/serverspeederot.sh: line 14: `Get_OS_Bit()
看看GitHub上的issues
看过了,还是一样出错,Ubuntu 14.04系统
已经更新,重新食用,先删除再重新按照食用方法即可
再次使用,最后日志输出是不是有问题
Mem free is 560
SO , Here in put 550
InPUT MEM FREE(default 512): 550
./serverspeederot.sh: line 105: bc: command not found
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command
(license 461AEB0EAF2D522792d0c9ca)
生效!
请到Github向我发送issues
最终全部解决,不报错了,脚本报错的地方,语法可能有问题,参考你前面不报错的代码,改了下,正常了
请问怎么改的 我也是这个错误
提交一下你怎么修改的,以便方便大家
Input MEM FREE(default 512): 这我也是日了狗了 望解答
请问是不是下载就能用了?不用复制粘贴代码?
total used free shared buffers cached
Mem: 490 275 215 0 9 126
-/+ buffers/cache: 138 351
Swap: 511 0 511
Please Input Mem Free:
For Exmple:
IF YOUR MEMINFO just like this:
total used free shared buffers cached
Mem: 1002 560 442 0 144 212
Mem free is 560
SO , Here in put 550
Input MEM FREE(default 512): 560
sed:-e 表达式 #1,字符 15:未终止的“s”命令
sed:-e 表达式 #1,字符 15:未终止的“s”命令
SH主要无法上传呐。。
能不能发一份sh文件,改了里面的一些符号还是报错
已经上传到GitHub
脚本有问题啊。。麻烦给个SH,谢谢! [email protected]
查收
老哥 我给你发邮件了 能不能把SH发给我
不如直接给个SH文件…
我重新放到GitHub咯
运行不了,不知道哪里错了,serverspeederot.sh文件内容,复制的是文中的代码,过程如下:
root@yyyyy:~# vim ./serverspeederot.sh
root@yyyyy:~# bash serverspeederot.sh
“#############################################################”
“# ServerSpeeder Optimization 1.0 For 91Yun ServerSpeeder
“# Author: J2S016 233
“# Thanks: @91Yun
“#############################################################”
serverspeederot.sh: line 16: conditional binary operator expected
serverspeederot.sh: line 16: syntax error near `WORD_BIT’
serverspeederot.sh: line 16: `if [[ getconf WORD_BIT = ’32’ && getconf LONG_BIT = ’64’ ]] ; then’
root@yyyyy:~#
这种代码还是用代码格式吧,光是全角半角都要难倒一批新手。
不建议这么直接写出来,反而误导人。
主要没别的,上传不了啊。目前已经迁移到Github 欢迎测试
Github地址是?
Upload On Github: github.com/JulySnow/91yunserverspeederot
食用方法:wget https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh && bash ./serverspeederot.sh
发现问题及时反馈与我。
出错!
sed: -e expression #1, char 15: unterminated `s’ command
sed: -e expression #1, char 15: unterminated `s’ command