Apache - how to limit the maximum file upload speed? (if not apache, I can run lighthttpd)

I have a bunch of videos, but I want to limit the maximum download speed for these files to 1 Mbps. How can I install this (ideally in Apache, but lighthttpd is an option)

thanks

+4
source share
2 answers

If you want to limit the download speed for each connection, regardless of the management of totals or the execution of smaller 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 have researched and tried other methods and modules, and in this particular case mod_ratelimit compresses the easiest way to do this.

Download speed limiting and throttling for Apache 2.4 .

+3
source

You can try mod_bandwidth or the more advanced mod_cband .

Quote from mad_bandwidth:

Mod_bandwidth is an Apache web server module that allows setting bandwidth limits at the server level or per channel, based on the directory, file size and remote IP / domain.

Quote from the mod_cband site:

mod_cband is an Apache 2 module designed to solve the problem of restricting users and using the bandwidth of virtual hosts. Electric current versions can set bandwidth quotas for virtual hosts and users, maximum download speed (for example, Mod_bandwidth ), speed of requests per second and maximum number of simultaneous IP connections (for example, in mod_limitipconn )

Here is a tutorial on how to use cband to limit download speeds .

+1
source

Source: https://habr.com/ru/post/1445689/


All Articles