Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

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

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

like image 287
Chris W. Avatar asked Jun 11 '12 17:06

Chris W.


3 Answers

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

like image 66
Chris W. Avatar answered Dec 22 '22 01:12

Chris W.


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.

like image 29
Anatoly Avatar answered Dec 22 '22 00:12

Anatoly


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 :(

like image 29
Xosler Avatar answered Dec 21 '22 23:12

Xosler