Skip to content

VIP 26: limit private prefetch

Nils Goroll edited this page Apr 23, 2019 · 6 revisions

Synopsis

  • Add means to limit the amount of data prefetched for private objects
  • Limit the Transient storage in size by default

Why

While HTTP/1 pipe mode uses a fixed buffer to relay the backend response, for private objects via pass/hfm/hfp, all backend response data is prefetched as quickly as possible from the backend. This requires potentially unbound amounts of storage and may trigger unexpected errors when transient stevedore allocations (malloc() in most practical cases) fail. User expectations are that private object require virtually no cache memmory.

Ref: https://github.com/varnishcache/varnish-cache/issues/2964

How

  • Make the Transient Stevedore limited to 100MB by default
  • add a parameter pass_prefetch with 1MB default
  • make pass_prefetch adjustable from vcl as req.pass_prefetch
  • add a no-fail mode to stevedore allocations where the requester gets notified (via a CV) by the stevedore as soon as there is memory available again.
  • use the no-fail mode for private objects
Clone this wiki locally