使用 iperf3 工具测试本地到 VPS 的连接速度

Kevin 教程 5,441 次浏览 13条评论

在右侧专题页面曾介绍多个 VPS 测速脚本,它们工作原理是通过 speedtest、fast.com 公共测速节点来完成。很多时候不能真实反映到本地的连接速度,最直接方法还是从本地主动发起测试。这操作起来也简单,用 iperf3 这个工具可以从本地测试 VPS 可达的最大带宽速度,支持 TCP /UDP 多线程并发测速。

获取安装 iperf3

CentOS yum -y install iperf3
Ubuntu apt-get -y install iperf3

VPS 和本地都要安装。CentOS 或 Ubuntu 系统可以直接在自带软件源里获得。其它 Linux 发行版、macOS 或 Windows 系统,可以从这里下载

Windows 版本下载解压后,不是直接运行 .exe 文件,而是将解压文件(不包括文件夹)放入到 系统盘:\Windows\System32 文件夹下,之后以管理员身份运行“命令提示符”输入测速命令。

iperf3 测速用法

先在 VPS 上运行 iperf3 进程。其中 -s 参数表示服务器端,-p 指定使用端口(默认端口 5201。别忘了防火墙放行端口)。如果需要以守护进程后台运行,追加 -D 参数。

iperf3 -s -p 5201

然后在本机发起测速。其中 -c 参数表示客户端并指定测速服务器地址,-p 指定服务器端口,-t 指定测试时长(单位秒),-P 指定并发连接数(越高越能测试到速度极限),-R 表示下载测速(不加参数则测试上传速度)。如果要测试 UDP 连接,追加 -u 参数。点此查看完整参数

iperf3 -c x.x.x.x -p 5201 -t 60 -P 10 -R

运行结果如下图,[SUM] 行就是测试数据(以 receiver 为准),带宽测速平均每秒 74.9 Mbits。

iperf3 VPS 测速

评论列表

  1. #1

    Hi, very nice website, cheers!
    ——————————————————
    Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
    ——————————————————
    Check here: https://www.reliable-webhosting.com/

  2. #2

    I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion,
    if all web owners and bloggers made good content as you did, the web will be much
    more useful than ever before.

    My web-site; Buy Nembutal Pentobarbital Sodium (Injectable)

  3. #3

    I believe that is one of the such a lot vital information for me.
    And i’m glad studying your article. But wanna statement on few normal things, The site style is great,
    the articles is really nice : D. Good task, cheers

    Also visit my web site Tempur-pedic Buying Guide

  4. #4

    Tremendous issues here. I’m very satisfied to peer
    your article. Thank you so much and I am having a look ahead to contact you.
    Will you kindly drop me a mail?

    My web blog … Tempur-pedic Breeze

  5. #5

    It’s really a cool and helpful piece of info. I am happy that you shared this useful
    info with us. Please stay us informed like this. Thank
    you for sharing.

    Feel free to visit my blog post – pozycjonowanie stron

  6. #6

    I enjoy what you guys are up too. Such clever work and
    exposure! Keep up the superb works guys I’ve included
    you guys to blogroll.

    Feel free to surf to my web-site – mrpiracy

  7. #7

    Thanks for one’s marvelous posting! I actually enjoyed reading it, you
    can be a great author.I will make sure to bookmark your blog and
    will eventually come back at some point. I want to encourage one to continue your
    great writing, have a nice evening!

    Feel free to visit my homepage :: Discover More Here

  8. #8

    It is appropriate time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I want to suggest you few interesting things or
    advice. Perhaps you can write next articles referring to this article.
    I desire to read even more things about it!

    Feel free to visit my website unblocked

  9. #9

    Magnificent goods from you, man. I have understand your stuff
    previous to and you’re just too excellent. I really like what you’ve
    acquired here, really like what you’re saying and the way in which you say it.
    You make it entertaining and you still care for to keep it smart.
    I can’t wait to read far more from you. This is really a great
    website.

    Here is my web page – Maisie

  10. #10

    Very nice post. I just stumbled upon your weblog and wanted to say that I’ve really enjoyed surfing around your blog posts.
    In any case I’ll be subscribing to your feed and I hope you write again very
    soon!

    Here is my blog – pool installation service

  11. #11

    Thank you a bunch for sharing this with all folks you actually recognize what you are speaking about!
    Bookmarked. Please additionally consult with my site =). We may have a hyperlink exchange arrangement between us

    my blog post :: projectfreetv

  12. #12

    buy silagra online uk

  13. #13

    flomax liquid

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。