Hi,

I've just noticed that mod_ratelimit does not work as expected with
mod_proxy_fcgi. I set a download limit to 500 KB/s for PHP (php-fpm) and
for some reason I'm still able to download at full speed.
If download limit is set to some low value e.g. 10 KB/s it pretty much
works (see results).

Configuration 1:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://
127.0.0.1:9000/home/adam/apache2.4/htdocs/$1
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 500

Results 1 (download 74 MB file with wget with rate_limit set to 500):
2014-02-12 14:32:25 (3.83 MB/s) - `file.php' saved [76581888/76581888]

Configuration 2:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://
127.0.0.1:9000/home/adam/apache2.4/htdocs/$1
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 10

Results 2 (download 74 MB file with wget with rate_limit set to 10):
2014-02-12 15:32:05 (13.3 KB/s) - `file.php' saved [76581888/76581888]

I've tested this issue on LAN and internet and always got the same results.

PHP script that can be used to test this issue can be found here (only path
to file needs to be set):
http://pastebin.com/zXWUMaxf

Thanks,
Adam

Reply via email to