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

浪子不回头ぞ 提交于 2019-12-01 06:10:55

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

<Location /files>
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 1000
</Location>

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.

You can try mod_bandwidth or more advanced mod_cband.

Quote from mad_bandwidth site:

Mod_bandwidth is a module for the Apache webserver that enable the setting of server-wide or per connection bandwidth limits, based on the directory, size of files and remote IP/domain.

Quote from mod_cband site:

mod_cband is an Apache 2 module provided to solve the problem of limiting users’ and virtualhosts’ bandwidth usage. The current versions can set virtualhosts’ and users’ bandwidth quotas, maximal download speed (like in mod_bandwidth), requests-per-second speed and the maximal number of simultanous IP connections (like in mod_limitipconn)

Here is tutorial about how to use cband to limit download speed.

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