千兆网络优化

直接上干货

Linux

 1 net.ipv4.tcp_slow_start_after_idle = 0
 2 net.ipv4.tcp_mem = 13107200 15728640  18350080
 3 net.ipv4.tcp_rmem = 140000000   1700000000   2000000000
 4 net.ipv4.tcp_wmem = 140000000   1700000000   2000000000 
 5 net.ipv4.tcp_ecn = 0 
 6 net.ipv4.tcp_ecn_fallback = 0
 7 net.ipv4.tcp_max_syn_backlog = 20000 
 8 net.ipv4.tcp_max_tw_buckets = 50000 
 9 net.ipv4.tcp_adv_win_scale = 1
10 net.ipv4.tcp_mtu_probing = 0
11 net.ipv4.tcp_base_mss = 1460
12 net.ipv4.tcp_challenge_ack_limit = 1000
13 net.ipv4.tcp_invalid_ratelimit = 500
14 net.ipv4.tcp_sack = 1
15 net.ipv4.tcp_fack = 1
16 net.ipv4.ipfrag_high_thresh = 16777216
17 net.ipv4.ipfrag_low_thresh = 15728640
18 net.ipv4.tcp_timestamps = 0
19 net.ipv4.tcp_base_mss = 1460
20 net.core.rmem_max = 2000000000 
21 net.core.wmem_max = 2000000000 
22 net.core.rmem_default = 140000000 
23 net.core.wmem_default = 140000000 
24 net.core.somaxconn = 65535 
25 net.core.netdev_max_backlog = 40000 
26 net.core.optmem_max = 512000
27 vm.dirty_background_ratio = 2
28 vm.dirty_ratio = 4
29 vm.dirty_writeback_centisecs = 200
30 vm.dirty_expire_centisecs = 500

windows

Set-NetTCPSetting -SettingName "InternetCustom"  -DelayedAckFrequency 2
Set-NetTCPSetting -SettingName  "internetcustom" -DelayedAckTimeoutMs 20
Set-NetTCPSetting -SettingName  "internetcustom" -CongestionProvider CTCP
Set-NetTCPSetting -SettingName "InternetCustom" -InitialCongestionWindowMss 64
Set-NetTCPSetting -SettingName "InternetCustom"  -MemoryPressureProtection disable
Set-NetTCPSetting -SettingName "InternetCustom"  -CwndRestart  False
Set-NetTCPSetting -SettingName "InternetCustom"  -AutoTuningLevelLocal Experimental

netsh int ipv4 set dynamicportrange protocol=tcp start=1025 num=64511

netsh int ipv4 show dynamicportrange protocol=tcp

 MTU 9000

windows
修改网卡mtu
先用如下命令查看所有的网卡以及他们的MTU的值。
        netsh interface ipv4 show interfaces
使用如下的命令修改他们的MTU为9000.
        netsh interface ipv4 set subinterface "13" mtu=9000 store=persistent

linux
ifconfig  ens192 mtu 9000 up
网卡配置文件新增MTU=9000
测试MTU大小
ping -f -l 1500 192.168.9.1
查看网卡性能
ethtool ens192
tcp网卡传输队列大小
ip link set txqueuelen 10000 dev ens192

 

posted @ 2022-01-19 18:10  知_行  阅读(121)  评论(0编辑  收藏  举报