鍍金池/ 問答/Linux/ 新安裝 Linux,udp 正常, TCP 大流量異常,

新安裝 Linux,udp 正常, TCP 大流量異常,

ryzen 1700 + 華碩 b350 plus,裝上 ubuntu 16.04.4。
安裝完成后發(fā)現(xiàn)傳輸大文件的時候會出現(xiàn)異常。

情景:

scp 一個大文件,起初能達到 10M+ 傳輸速度,然后會慢慢下降。
ping linux, 起初正常,傳輸大文件時,會出現(xiàn)丟包高延遲包

64 bytes from 192.168.0.200: icmp_seq=664 ttl=64 time=0.278 ms
64 bytes from 192.168.0.200: icmp_seq=665 ttl=64 time=0.275 ms
64 bytes from 192.168.0.200: icmp_seq=676 ttl=64 time=7772 ms
64 bytes from 192.168.0.200: icmp_seq=677 ttl=64 time=6773 ms
64 bytes from 192.168.0.200: icmp_seq=678 ttl=64 time=5773 ms
64 bytes from 192.168.0.200: icmp_seq=679 ttl=64 time=4773 ms
64 bytes from 192.168.0.200: icmp_seq=680 ttl=64 time=3773 ms
64 bytes from 192.168.0.200: icmp_seq=681 ttl=64 time=2773 ms
64 bytes from 192.168.0.200: icmp_seq=682 ttl=64 time=1773 ms
64 bytes from 192.168.0.200: icmp_seq=683 ttl=64 time=773 ms
64 bytes from 192.168.0.200: icmp_seq=684 ttl=64 time=0.217 ms

初步診斷

  1. 檢查網(wǎng)口協(xié)議正常千兆

enp30s0: negotiated 1000baseT-FD flow-control, link ok
更換 網(wǎng)線 和 測試其他 Linux,基本排除外部網(wǎng)絡(luò)故障

  1. 使用 iperf 進一步測試

    1. 內(nèi)部機器測試
      127.0.0.1 和 內(nèi)網(wǎng)ip 都沒有問題
    2. 兩臺機器間測試

      udp 協(xié)議測試正常 iperf -u -s

      [  3] local 192.168.0.200 port 5001 connected with 192.168.0.174 port 57095
      [ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
      [  3]  0.0-20.0 sec   228 MBytes  95.7 Mbits/sec   0.475 ms 2147158096/2147320872 (1e+02%)
      

      tcp 協(xié)議就出現(xiàn)問題 iperf -s,網(wǎng)絡(luò)迅速下降,同時 ping 丟包,高延遲

      [  5] local 192.168.0.200 port 5001 connected with 192.168.0.174 port 53736
      [  5]  0.0-21.0 sec  43.1 MBytes  17.2 Mbits/sec
      [  4] local 192.168.0.200 port 5001 connected with 192.168.0.174 port 53996
      [  4]  0.0-50.0 sec   177 MBytes  29.6 Mbits/sec
  2. 使用 ubuntu desktop 16.04.2 cd linux 測試這個情景,沒有再現(xiàn)這個問題。

請教一下怎么排查這個問題?

回答
編輯回答
凝雅

之前看到過一個 tcp 擁塞算法 bbr,需要通過升級內(nèi)核實現(xiàn),我就猜可能是內(nèi)核導(dǎo)致的問題,于是我就使用網(wǎng)上的一鍵 bbr 腳本,內(nèi)核 4.4 升級了到了 4.15,然后測試 udp,tcp 都正常了。原來內(nèi)核上的哪個問題還是不清楚。

2018年6月11日 17:55