Apache - how to limit maximum download speed of files? (if not apache, i can run lighthttpd)

后端 未结 2 520
醉酒成梦
醉酒成梦 2021-01-13 03:13

I have a bunch of videos but I only want to limit the maximum download speed for these files to be 1mbps. How can I set this up (ideally in Apache but lighthttpd is an optio

2条回答
  •  梦毁少年i
    2021-01-13 03:42

    If you only want to limit the download speed per connection, without any regard for managing the totals or performing more fine-grained controls, the best way to handle this is to use Apache's own mod_ratelimit.

    This example restricts everything under /files to 1Mbit/s...

    
        SetOutputFilter RATE_LIMIT
        SetEnv rate-limit 1000
    
    

    I've researched and tried other methods and modules, and in this specific case, mod_ratelimit is hands down the easiest way to do this.

    Download Speed Limit and Throttling for Apache 2.4.

提交回复
热议问题