一个网站
你懂的

91Yun ServerSpeeder 优化工具

本文由@julysnow233发布

用了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这两个参数请自行调整,因为无法判断是否是美国主机,开启了部分主机会降低速度

打赏
未经允许不得转载:91云(91yun.org) » 91Yun ServerSpeeder 优化工具

留言 46

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #16

    sed: -e expression #1, char 47: unknown option to `s’

    请问下如何解决呢?

    BlackTouma4周前 (01-25)回复
    • 同问

      Re_keto4周前 (01-26)回复
    • 同问

      xsteven2周前 (02-08)回复
  2. #15

    安装成功
    但安装玩之后好像没感觉到加速啊,好像还慢了那么一点点。
    美国的VPS,要怎么设置?

    屋仔1个月前 (01-07)回复
    • 根据TCP协议自己慢慢研究配置文件咯…调整是需要有基础的。

      Michael1个月前 (01-07)回复
      • 好的,现在已经在调整了,谢谢你的回复。

        屋仔1个月前 (01-07)回复
  3. #14

    “#############################################################”
    “# 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’

    wepr2个月前 (12-17)回复
  4. #13

    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

    小猫尾巴4个月前 (11-07)回复
    • 看到了,你得输入,你直接回车他计算不出来数据

      julysnow2333个月前 (11-11)回复
  5. #12

    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
    请问这是咋回事

    小猫尾巴4个月前 (11-07)回复
    • 输入数字啊,你的如果是512就输入512,default 512意思是锐速自带的是512加速

      julysnow2333个月前 (11-11)回复
  6. #11

    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
    生效!
    还是报错,希望你能帮忙。

    zhtpiaoxue4个月前 (11-06)回复
    • 貌似是锐速的问题,请发issues

      julysnow2333个月前 (11-11)回复
  7. #10

    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,效果就是这么一个效果

    troy2qn4个月前 (11-01)回复
    • /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 没有这个文件或者目录
      貌似是锐速没有安装好诶

      julysnow2333个月前 (11-11)回复
  8. #9

    不会装啊,是复制代码到Xshell上执行,还是复制到Winscp的文件夹里,能否说明详细些

    lomusive4个月前 (10-30)回复
  9. #8

    填写完free mem后,提示sed: -e expression #1, char 15: unterminated s' command
    sed: -e expression #1, char 15: unterminated
    s’ command,然后就(license xxxxxxxxxxxxx)生效了。过程对么?

    xyz4个月前 (10-27)回复
  10. #7

    Upload On Github: github.com/JulySnow/91yunserverspeederot
    食用方法:wget https://raw.githubusercontent.com/JulySnow/91yunserverspeederot/master/serverspeederot.sh && bash ./serverspeederot.sh
    发现问题及时反馈与我。
    麻烦站长帮我加到上面谢谢!

    julysnow2334个月前 (10-13)回复
    • ‘: 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()

      刁大犬4个月前 (10-14)回复
    • 还是出错,日志:
      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()

      workboy4个月前 (10-15)回复
    • 主要出错日子
      ‘: 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()

      workboy4个月前 (10-15)回复
      • 看看GitHub上的issues

        julysnow2334个月前 (10-15)回复
        • 看过了,还是一样出错,Ubuntu 14.04系统

          workboy4个月前 (10-15)回复
          • 已经更新,重新食用,先删除再重新按照食用方法即可

            julysnow2334个月前 (10-15)
        • 再次使用,最后日志输出是不是有问题
          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)
          生效!

          workboy4个月前 (10-15)回复
          • 请到Github向我发送issues

            julysnow2334个月前 (10-16)
        • 最终全部解决,不报错了,脚本报错的地方,语法可能有问题,参考你前面不报错的代码,改了下,正常了

          workboy4个月前 (10-16)回复
          • 请问怎么改的 我也是这个错误

            Jeesa4个月前 (10-16)
          • 提交一下你怎么修改的,以便方便大家

            julysnow2333个月前 (11-11)
    • Input MEM FREE(default 512): 这我也是日了狗了 望解答

      rabook4个月前 (10-19)回复
    • 请问是不是下载就能用了?不用复制粘贴代码?

      bitch4个月前 (10-21)回复
    • 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”命令

      bitch4个月前 (10-23)回复
  11. #6

    SH主要无法上传呐。。

    julysnow2334个月前 (10-13)回复
  12. #5

    能不能发一份sh文件,改了里面的一些符号还是报错

    kmm4个月前 (10-10)回复
    • 已经上传到GitHub

      julysnow2334个月前 (10-15)回复
  13. #4

    脚本有问题啊。。麻烦给个SH,谢谢! jeansunny@126.com

    jeansunny4个月前 (10-09)回复
    • 查收

      julysnow2334个月前 (10-16)回复
  14. #3

    不如直接给个SH文件…

    Qa5个月前 (10-08)回复
    • 我重新放到GitHub咯

      julysnow2334个月前 (10-15)回复
  15. #2

    运行不了,不知道哪里错了,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:~#

    workboy5个月前 (10-08)回复
  16. #1

    这种代码还是用代码格式吧,光是全角半角都要难倒一批新手。
    不建议这么直接写出来,反而误导人。

    Abclite5个月前 (10-07)回复
    • 主要没别的,上传不了啊。目前已经迁移到Github 欢迎测试

      julysnow2334个月前 (10-15)回复