在测试环境(Mac OS X)中模拟较差的带宽? [英] Simulate poor bandwidth in a testing environment (Mac OS X)?

查看:126
本文介绍了在测试环境(Mac OS X)中模拟较差的带宽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个自定义的Flash/HTML5视频播放器,供我们网站上的用户使用.我目前正在充实那些次优"带宽用户的体验-基本上,我们希望客户端代码能够检测到由于过度缓冲而导致的不良用户体验.我想在我的本地开发环境中测试此带宽不足"处理代码.

We have a customized Flash/HTML5 video player we use for users on our site. I'm currently fleshing out the experience for users who have 'suboptimal' bandwidth--basically we'd like the client side code to be able to detect poor user experience due to excessive buffering. I would like to test this "poor bandwidth" handling code in my local development environment.

有人知道用于在测试环境中模拟带宽不足"的好技术吗?

Does anyone know of good techniques for simulating "poor bandwidth" in a local environment for testing purposes?

更具体地说,我将本地浏览器连接到具有uWSGI,nginx和python/django实例的虚拟机,我希望能够为这些系统中的内容传递任意数量的延迟. (我主要关心的是使用nginx进行此操作,后者执行视频内容的传输/流传输.)

More specifically I have my local browser connecting to a virtual machine with instances of uWSGI, nginx, and python/django and I would like to be able to inject arbitrary amounts of delay into the delivery of content from these systems. (I'm primarily concerned with doing this with nginx, which does the video content delivery/streaming).

开发环境为Mac OS X可能与之相关.

It may be relevant that the dev environment is Mac OS X.

推荐答案

只需使用nginx的配置.

虽然OS X Lion的网络链接调节器可以按预期工作,但当我真的只是在尝试测试Web应用程序的行为的一部分(即,缓慢的视频缓冲处理)时,仍会烦人系统.

While OS X Lion's Network Link Conditioner works as expected it's still annoying to use when I'm really just trying to test a subset of a web app's behavior--i.e., the slow video buffering handling system.

因此,我发现在我的nginx.conf文件中设置速率限制更为方便,例如:

As such, I've found it much more convenient to set rate limiting in my nginx.conf file, e.g.,:

location ~ /files/(.*\.(mp4|m4v|mov))$ {
    ...
    limit_rate 50k;  #  <-- Limit download rate per connection to 50kbps
    ...
}

请参见 nginx HttpCoreModule文档.

这篇关于在测试环境(Mac OS X)中模拟较差的带宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆