I can confirm the behaviour you are seeing.

The rate_limit output filter is appearing in the list of output filters.

FILTER BYTYPE:DEFLATE
FILTER byterange
FILTER content_length
FILTER http_header
FILTER http_outerror
FILTER rate_limit
FILTER reqtimeout
FILTER core

I can only assume that the proxying mechanism that mod_wsgi daemon mode uses 
itself to limit in memory buffering (to avoid memory bloat) of data when the 
client is reading much slower than the WSGI application is producing, is 
interfering somehow. Even overriding the allowed amount of buffered data using 
response-buffer-size on WSGIDaemonProcess to try and short circuit to a degree 
what it does doesn't seem to change the behaviour though.

I will have to dig more into mod_ratelimit when I get a chance.

Can you create an issue at:

* https://github.com/GrahamDumpleton/mod_wsgi/issues 
<https://github.com/GrahamDumpleton/mod_wsgi/issues>

with details so can track it there.

Thanks.

Graham


> On 7 Feb 2018, at 1:04 pm, Charles Cazabon <[email protected]> wrote:
> 
> On Tuesday, February 6, 2018 at 4:46:36 PM UTC-6, Graham Dumpleton wrote:
> How are you measuring the rate at which data is being returned? Is there a 
> specific client command you are using? If I know that I can test. Include any 
> example of running it and what output you see and expect to see.
> 
> Thanks for the reply.  Pretty much any client will do; it is perhaps easiest 
> with curl or wget.  Example retrieving a 64MB file through the trivial WSGI 
> app and Apache config given before (file is just 64MB of random data):
> 
> $ curl -o output http://bwtest.example.com/ <http://bwtest.example.com/>
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  
> Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100 64.0M  100 64.0M    0     0  9362k      0  0:00:06  0:00:06 --:--:-- 10.9M
> 
> That average download speed is ~9MB/s, far in excess of the 512KB/s I've 
> configured with mod_ratelimit for that vhost.
> 
> If I just comment out the WSGIScriptAlias directive in the vhost config, so 
> the same file can be served as a static file by Apache with the same vhost 
> config:
> $ curl -o output http://bwtest.example.com/64M 
> <http://bwtest.fatdrop.co.uk/64M>
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  
> Current
>                                  Dload  Upload   Total   Spent    Left  Speed
> 100 64.0M  100 64.0M    0     0   508k      0  0:02:08  0:02:08 --:--:--  505k
> 
> ... you can see the effective download speed is just under the configured 
> limit of 512KB/s.
> 
> Charles
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to