Simulate poor bandwidth in a testing environment (Mac OS X)?

一个人想着一个人 提交于 2019-12-02 22:39:36

Just use nginx's configuration.

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.

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
    ...
}

EDIT: See the nginx HttpCoreModule docs.

FreeBSD is ancestor of Mac OS, so you can use built-in powerful firewall called ipfw. It can be used in many different cases, for example simulate low bandwidth. Use your own IP address loopback (127.0.0.1) or a remote server (8.8.8.8 in that case).

We do a video interviewing web-application, so I'd like to share with our experience of simulation of bad connection, see example below:

$ sudo su

$ ipfw show
$ ipfw pipe 1 config delay 600ms bw 256kbit/s
$ ipfw add pipe 1 dst-ip 8.8.8.8 dst-port 80

$ ipfw flush

ipfw pipe allows you to simulate slow and unstable connection with using delay, bw and even prob to simulate packet losses.

I just found the Mac OS X Network Link Conditioner but I'm not yet sure it works on loopback, which it would need to for my purposes.

EDIT: This seems to work on loopback, so it seems to solve my problem! This is probably the way to go if you're on OS X 10.7

I'm using this program NetLimiter to simulate "poor bandwidth". It's not free, but have a trial version that works well. Is only for windows :(

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!