Linux dynamic rate limiting/throttling

bandwidth-controllinuxrate-limiting

I'm running a video streaming website with lighttpd using http pseudo-streaming to deliver videos. If the user has a very fast connection, this can use bandwidth quite inefficiently. For example if the user downloads a whole video file but only watches half, this wastes a lot of bandwidth.

A potential solution to this problem would be RTMP, but that can have problems with firewalls and will not let users on slow connections buffer the video.

A better solution would be to limit the video delivery rate to, for example, 1.25 times the bitrate of the video. This means that users can still pause and buffer the video, but users on a really fast connection will not waste bandwidth. This functionality is offered by lighttpd 1.50 by sending the X-LIGHTTPD-KBytes-per-second, but development has ceased.

Is there any other way to do this in linux?

Best Answer

According to this document, lighttpd supports per-server and per-connection rate limits.

The linux traffic shaping subsystem, documented here, will give you a lot more control over this sort of thing, but at the expense of a much higher learning curve.

Related Topic