c++测试带宽程序_如何模拟低带宽连接以测试网站和应用程序

c++测试带宽程序

c++测试带宽程序

Facebook just announced an internal initiative called "2G Tuesdays" and I think it's brilliant. It's a clear and concrete way to remind folks with fast internet (who likely have always had fast internet) that not everyone has unlimited bandwidth or a fast and reliable pipe. Did you know Facebook even has a tiny app called "Facebook Lite" that is just 1Mb and has good support for slower developing networks?

Facebook刚刚宣布了一项名为“ 2G Tuesdays ”的内部计划,我认为这是很棒的。 这是一种提醒人们使用快速互联网(可能一直拥有快速互联网)的人们的清晰而具体的方法,并不是每个人都有无限的带宽或快速可靠的管道。 您是否知道Facebook甚至有一个名为“ Facebook Lite ”的微型应用程序,其容量仅为1Mb,并且对较慢的网络提供了良好的支持?

You should always test your websites and applications on a low bandwidth connection, but few people take the time. Many people don't know how to simulate simulate low bandwidth or think it's hard to set up.

您应该始终在低带宽连接上测试您的网站和应用程序,但是很少有人花时间。 许多人不知道如何模拟模拟低带宽,或者认为很难设置。

使用谷歌浏览器模拟低带宽 (Simulating low bandwidth with Google Chrome)

If you're using Google Chrome, you can go to the Network Tab in F12 Tools and select a bandwidth level to simulate:

如果您使用的是Google Chrome浏览器,则可以转到F12工具中的“网络”标签,然后选择要模拟的带宽级别:

Selecting lower bandwidth in Google Chrome F12 Tools

Even better, you can also add Custom Profile to specify not only throughput but custom latency:

更好的是,您还可以添加自定义配置文件,以不仅指定吞吐量,还可以指定自定义延迟:

Custom Profiles for Google Chrome that control throughput and latency

Once you've set this up, you can also click "disable cache" and simulate a complete cold start for your site on a slow connection. 20 seconds is a long time to wait.

设置完之后,您还可以点击“禁用缓存”,并在慢速连接上为您的站点模拟一个完整的冷启动。 20秒是很长的等待时间。

Google Chrome timeline showing my site on a 2G connection

模拟与Fiddler等代理服务器的慢速连接 (Simulating a slow connection with a Proxy Server like Fiddler)

If you aren't using Chrome or you want to simulate a slow connection for your apps or other browsers, you can slow it down from a Proxy Server like Fiddler or Charles.

如果您没有使用Chrome,或者想为应用或其他浏览器模拟慢速连接,则可以通过FiddlerCharles之类的代理服务器来降低连接速度。

Fiddler has a "simulate modem" option under Rules | Performance, and you can change the values from Rules | Customize Rules:

Fiddler在“规则” |“规则”下有一个“模拟调制解调器”选项。 性能,您可以从规则|更改值。 自定义规则:

image

You can put in delays in milliseconds per KB in the script under m_SimulateModem:

您可以在m_SimulateModem下的脚本中以毫秒为单位,以每KB毫秒为单位:

if (m_SimulateModem) {
// Delay sends by 300ms per KB uploaded.
oSession["request-trickle-delay"] = "300";
// Delay receives by 150ms per KB downloaded.
oSession["response-trickle-delay"] = "150";
}

There's a number of proxy servers you can get to slow down traffic across your system. If you have Java, you can also try out one called "Sloppy." What's your favorite tool for slowing traffic down?

您可以通过许多代理服务器来降低系统中的流量。 如果您有Java,也可以尝试一种名为“ Sloppy ”的软件。 您最喜欢用来减慢流量的工具是什么?

结论 (Conclusion)

There is SO MUCH you can do to make the experience of loading your site better, not just for low-bandwidth folks, but for everyone. Squish your images! Don't use PNGs when a JPEG would do. Minify! Use CDNs!

您可以做很多事情,以改善加载站点的体验,不仅对低带宽人员,而且对每个人都如此。 压缩图像! JPEG可以使用时不要使用PNG。 缩小! 使用CDN!

However, step 0 is actually using your website on a slow connection. Go do that now.

但是,步骤0实际上是在慢速连接上使用您的网站。 现在去做。

相关链接 (Related Links)

翻译自: https://www.hanselman.com/blog/how-to-simulate-a-low-bandwidth-connection-for-testing-web-sites-and-applications

c++测试带宽程序

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值