1、Install the BBR

$ wget --no-check-certificate https://raw.githubusercontent.com/princelai/across/master/bbr.sh

$ chmod +x bbr.sh
$ ./bbr.sh

$ echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf

$ echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

$ sysctl -p

$ lsmod | grep bbr
2、Edit the limits.conf

$ vi /etc/security/limits.conf

  • soft nofile 51200
  • hard nofile 51200
    $ ulimit -n 51200

3、Tune the kernel parameters
$ vi /etc/sysctl.conf
fs.file-max = 51200

net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.core.netdev_max_backlog = 250000
net.core.somaxconn = 4096

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 10000 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_mem = 25600 51200 102400
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_mtu_probing = 1

$ sysctl -p
4、install the shadowsocks
$ python --version
Python 2.6.8
$ pip install shadowsocks

5、start server
$ vi test.json

{

"server":"my_server_ip",
"server_port":8388,
"local_port":1080,
"password":"barfoo!",
"timeout":600,
"method":"aes-256-cfb"

}

$ sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start

or

$ ssserver -c /etc/shadowsocks.json

or

$ shadowsocks.ssserver -p 443 -k password -m aes-256-cfb

标签: 梯子

添加新评论