Enabling the transit buffer feature allows Varnish to pace backend streaming passes to not consume too much memory. The varnishd
feature transit_buffer
sets the maximum number of bytes that the client can be ahead of the backend during the streaming pass.
This enables transit buffering for all streaming passes. Varnish will let the client be 1 MiB ahead of the backend before waiting. This will not reduce the performance of streaming transfers.
varnishd -p transit_buffer=1M
This enables transit buffering for the current backend fetch operation.
sub vcl_backend_response {
set beresp.transit_buffer = 1M;
}