Mobile app version of vmapp.org
Login or Join
Murray432

: Strange behaviour with Apache mod_ratelimit I'm trying to use mod_ratelimit, but it's exhibiting some odd behaviour. Initially, my configuration was: <Virtualhost> ... <Directory /var/www/public>

@Murray432

Posted in: #Apache #Apache2

I'm trying to use mod_ratelimit, but it's exhibiting some odd behaviour.

Initially, my configuration was:

<Virtualhost>
...
<Directory /var/www/public>
Order Allow,Deny
Allow from All

Options FollowSymLinks
AllowOverride All

SetOutputFilter RATE_LIMIT
SetEnv rate-limit 250
</Directory>
...
</Virtualhost>


I've also tried:

<Virtualhost>
...
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 250
...
</Virtualhost>


and

<Virtualhost>
<Location>
...
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 250
...
</Location>
</Virtualhost>


I was expecting the 8 MB file I was downloading to take about 30 seconds. It was done in an instant.

I've tried several values for rate-limit and used wget to time them:

rate-limit | download speed
-----------+---------------
250 | 440 MB/s
100 | 440 MB/s
50 | 440 MB/s
30 | 20 kB/s
25 | 20 kB/s
10 | 6 kB/s
1 | 500 B/s


This is apache 2.4 running on Ubuntu 14.04

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

This may be a silly question, however, I ask because it has been missed before: Is the module enabled?

You can see this in /etc/apache2/mods-enabled/. By default, this module is not enabled.

From: www.server-world.info/en/note?os=Ubuntu_14.04&p=httpd2&f=7

root@www:~# a2enmod ratelimit
root@www:~# vi /etc/apache2/conf-available/ratelimit.conf
# create new
# for example, limit bandwidth as 500 KB/sec under the /download location
<IfModule mod_ratelimit.c>
<Location /download>
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 500
</Location>
</IfModule>
root@www:~# a2enconf ratelimit
root@www:~# /etc/init.d/apache2 restart


Another popular option is mod_dialup found at: httpd.apache.org/docs/2.4/mod/mod_dialup.html

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme