You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop daemon response flushing from defeating mod_ratelimit.
When proxying a response body back from a daemon process, mod_wsgi forced
a flush both whenever the daemon socket momentarily ran dry and after each
response-buffer-size worth of data. Both forced the mod_ratelimit
RATE_LIMIT filter to emit short writes, so depending on the Apache version
a configured rate limit was either largely ineffective or applied far too
aggressively, never honoured accurately for a daemon mode response.
mod_wsgi requires Apache 2.4, whose core output filter already bounds how
much response data is buffered in the child processes, so these forced
flushes are not needed to limit memory use and have been removed. Response
data is now passed straight on, so a downstream pacing or batching filter
receives full-size writes and works correctly.
A new response-flush-delay option (default 5 milliseconds) controls how
long mod_wsgi waits for more data before flushing when the daemon socket
runs dry, so a transient stall during an active transfer no longer
triggers a flush while a genuinely idle application still has its partial
output flushed within the delay. Setting it to 0 flushes on any stall and
is not recommended when a pacing filter is in use.
The response-buffer-size option is repurposed as a coarse runaway guard
that forces a flush only once that many bytes have been passed downstream
without one, bounding a downstream filter that buffers without draining.
Its default is raised from 65536 bytes to 8388608 bytes accordingly.
0 commit comments