ubuntu 中测速永远无法超过 4m - V2EX
lidongdong1222

ubuntu 中测速永远无法超过 4m

  •  
  •   lidongdong1222 Nov 30, 2018 4351 views
    This topic created in 2725 days ago, the information mentioned may be changed or developed.
    新安装的 ubuntu,测试上传速度的时候永远无法超过 4m,同样环境安装的 centos 测速可以达到 40m,大概是什么原因呢?
    Supplement 1    Nov 30, 2018
    只有上行有问题,下行可以达到 300+
    11 replies    2018-12-02 03:38:46 +08:00
    LGA1150
        1
    LGA1150  
       Nov 30, 2018 via Android
    用什么工具测的? iperf3 ?
    liuxu
        2
    liuxu  
       Nov 30, 2018
    竟有如此怪异之事?我从 ubuntu12.04 用到现在 18.04 ,没见过
    iwtbauh
        3
    iwtbauh  
       Nov 30, 2018 via Android
    无线 or 有线?
    网卡型号?
    使用的驱动程序和版本?
    供应商固件版本?
    内核日志?
    liuxu
        4
    liuxu  
       Nov 30, 2018
    如果是用 speedtest 测试的话,是测试节点问题,不要迷信它们,最好自己搞个网盘实际测试一下

    liuxu:~$ speedtest
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (114.249.28.210)...
    Retrieving speedtest.net server list...
    Selecting best server based on ping...
    Hosted by Beijing Broadband Network (Beijing) [1.67 km]: 4.419 ms
    Testing download speed................................................................................
    Download: 92.63 Mbit/s
    Testing upload speed......................................................................................................
    Upload: 3.93 Mbit/s

    liuxu:~$ speedtest --server 5505
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (114.249.28.210)...
    Retrieving speedtest.net server list...
    Retrieving information for the selected server...
    Hosted by Beijing Broadband Network (Beijing) [1.67 km]: 5.469 ms
    Testing download speed................................................................................
    Download: 91.26 Mbit/s
    Testing upload speed.....................................................................................................
    Upload: 4.02 Mbit/s

    liuxu:~$ speedtest --server 17019
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (114.249.28.210)...
    Retrieving speedtest.net server list...
    Retrieving information for the selected server...
    Hosted by CoreLink, Inc. (Shanghai) [1074.57 km]: 28.922 ms
    Testing download speed................................................................................
    Download: 86.42 Mbit/s
    Testing upload speed......................................................................................................
    Upload: 12.03 Mbit/s

    liuxu:~$ speedtest --server 17184
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (114.249.28.210)...
    Retrieving speedtest.net server list...
    Retrieving information for the selected server...
    Hosted by China Mobile,TianJin (Tianjin) [111.65 km]: 18.27 ms
    Testing download speed................................................................................
    Download: 81.23 Mbit/s
    Testing upload speed......................................................................................................
    Upload: 12.55 Mbit/s
    lidongdong1222
        5
    lidongdong1222  
    OP
       Nov 30, 2018
    @LGA1150 @iwtbauh @liuxu

    用 speedtest-cli 测试的
    esxi 里直接跟主路由分配的同一块网卡
    没有开启防火墙,iptables 也没有配置任何东西

    driver: e1000
    version: 7.3.21-k8-NAPI
    firmware-version:
    expansion-rom-version:
    bus-info: 0000:02:01.0
    supports-statistics: yes
    supports-test: yes
    supports-eeprom-access: yes
    supports-register-dump: yes
    supports-priv-flags: no

    Settings for ens33:
    Supported ports: [ TP ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: off (auto)
    Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000007 (7)
    drv probe link
    Link detected: yes
    lidongdong1222
        6
    lidongdong1222  
    OP
       Nov 30, 2018
    @liuxu
    使用相同的节点,centos 里测速,wifi 下连接的笔记本测速上行都是 40,只有 ubuntu 里不到 5
    liuxu
        7
    liuxu  
       Nov 30, 2018
    @lidongdong1222

    用 --server 参数指定了相同节点?

    说实话,这个锅 ubuntu 不好接,毕竟都是 python 的,唯一不同的就是 user-agent 了

    def build_user_agent():
    """Build a Mozilla/5.0 compatible User-Agent string"""

    ua_tuple = (
    'Mozilla/5.0',
    '(%s; U; %s; en-us)' % (platform.system(), platform.architecture()[0]),
    'Python/%s' % platform.python_version(),
    '(KHTML, like Gecko)',
    'speedtest-cli/%s' % __version__
    )
    user_agent = ' '.join(ua_tuple)
    printer('User-Agent: %s' % user_agent, debug=True)
    return user_agent
    lidongdong1222
        8
    lidongdong1222  
    OP
       Nov 30, 2018
    @liuxu

    手动更改了 UA,也不行
    oovveeaarr
        9
    oovveeaarr  
       Nov 30, 2018   1
    换 python2
    lidongdong1222
        10
    lidongdong1222  
    OP
       Dec 1, 2018
    @oovveeaarr

    正解

    root@ubuntu:~$ python2 /usr/lib/python3/dist-packages/speedtest.py --no-download
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (123.118.10.37)...
    Retrieving speedtest.net server list...
    Selecting best server based on ping...
    Hosted by Beijing Unicom (Beijing) [1.67 km]: 31.197 ms
    Skipping download test
    Testing upload speed................................................................................................
    Upload: 42.66 Mbit/s

    root@ubuntu:~$ python3 /usr/lib/python3/dist-packages/speedtest.py --no-download
    Retrieving speedtest.net configuration...
    Testing from China Unicom Beijing (123.118.10.37)...
    Retrieving speedtest.net server list...
    Selecting best server based on ping...
    Hosted by Beijing Unicom (Beijing) [1.67 km]: 4.88 ms
    Skipping download test
    Testing upload speed......................................................................................................
    Upload: 1.66 Mbit/s
    liuxu
        11
    liuxu  
       Dec 2, 2018
    @oovveeaarr
    @lidongdong1222

    问题出在 python3 发送的 header 上

    t/513463
    About     Help     Advertise     Blog     API     FAQ     Solana     890 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 45ms UTC 22:29 PVG 06:29 LAX 15:29 JFK 18:29
    Do have faith in what you're doing.
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-11940834-2', 'v2ex.com'); ga('send', 'pageview'); ga('send', 'event', 'Node', 'topic', 'ubuntu'); ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86