![c++测试带宽程序](https://i-blog.csdnimg.cn/blog_migrate/ee6b90fc1d5a6c12062ae666864f00cc.png)
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 Selecting lower bandwidth in Google Chrome F12 Tools](https://i-blog.csdnimg.cn/blog_migrate/b3dc03cd642dd69ffeefcf98f40cb144.png)
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 Custom Profiles for Google Chrome that control throughput and latency](https://i-blog.csdnimg.cn/blog_migrate/dc3af0db46fe3f32dea560d39d6e790d.png)
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 Google Chrome timeline showing my site on a 2G connection](https://i-blog.csdnimg.cn/blog_migrate/62333bd16dd5c26834a129b6957058e6.png)
模拟与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,或者想为应用或其他浏览器模拟慢速连接,则可以通过Fiddler或Charles之类的代理服务器来降低连接速度。
Fiddler has a "simulate modem" option under Rules | Performance, and you can change the values from Rules | Customize Rules:
Fiddler在“规则” |“规则”下有一个“模拟调制解调器”选项。 性能,您可以从规则|更改值。 自定义规则:
![image image](https://i-blog.csdnimg.cn/blog_migrate/f9d08e7e4e1cbae0562760e6d514b87f.png)
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)
c++测试带宽程序