#!/bin/sh

sysctl -w net.core.somaxconn=10000
sysctl -w net.ipv4.tcp_max_syn_backlog=100000
sysctl -w net.ipv4.tcp_slow_start_after_idle=0
sysctl -w net.core.wmem_default=327680
sysctl -w net.core.wmem_max=3276800
sysctl -w net.core.rmem_default=327680
sysctl -w net.core.rmem_max=327680

sysctl -w net.ipv4.ip_local_port_range="1024 65535"
sysctl -w net.ipv4.ip_local_reserved_ports="3344,4444,5554,7063,9995,9996,1026,11211,53831,30754,42793,49393"

sysctl -w net.ipv4.tcp_retries2=120
sysctl -w net.ipv4.tcp_no_metrics_save=1
sysctl -w net.ipv4.tcp_no_delay_ack=1
sysctl -w net.ipv4.tcp_wmem="4096 262144 524288"
sysctl -w net.ipv4.tcp_rmem="4096 524288 524288"

sysctl -w net.ipv4.tcp_tw_recycle=0

ip route change `ip r | grep default` initcwnd 44

ip tcp_metric flush

sysctl -w vm.dirty_background_ratio=1

#echo 100000 >  /proc/sys/fs/aio-max-nr

#建议关闭，如果一定要开，建议设大
sysctl -w net.netfilter.nf_conntrack_max=25000000
sysctl -w net.netfilter.nf_conntrack_buckets=3000000

#需要开启bbr，请升级内核，查看是否升级bbr
lsmod | grep bbr
