How to limit server badwidth per user, not a webpage

apache-2.2bandwidth-control

I would like to limit the download speed of my .flv and my .mp4 files per user on my domain.
My page have got 1000-3000 visitor per day and they can't watch my things at the same time, cos 1-2 people get all my bandwidth.

I would like to give 200KiB/s / user…

If there are 10 listeners of my stream than they use 2Mib/s, not 30-40Mib/s…
And I would like to give them a minimum..

I tried
Bandwidth module, but it works for domains, not for user..

BandwidthModule On ForceBandWidthModule On LargeFileLimit .flv 1
204800 LargeFileLimit .mp4 1 204800

Is there any easy installable apache module? Or can I limit only download fibers? … Download speed limit by IP, or connection…

Best Answer

It looks like mod_cband is probably your best bet. The CBandRemoteSpeed directive specifically limits number of connections, connections per second, and connection speed per client IP. It doesn't appear to have a "per file-type" option. According to the documentation it's set per <VirtualHost> so if you only wanted to throttle .flv and .mp4 files you'd need to move them to a virtualhost by themselves (say streaming.example.com) and enable cband there.