vmod_vsthrottle memory usage

Guillaume Quintard guillaume at varnish-software.com
Wed Apr 11 12:02:13 UTC 2018


Hi cosimo,

Very simple, we crash and bring the whole thing down:
https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.c#L99

IIRC, on Linux, malloc always returns with an allocation, or OOM-kills you

-- 
Guillaume Quintard

On Wed, Apr 11, 2018 at 12:47 PM, Cosimo Streppone <cosimo at streppone.it>
wrote:

> Hi,
>
> I'm looking at the vsthrottle vmod. Have a proof of concept VCL up and
> running,
> and it seems to work very nicely (with varnish 4.1.9). Thanks for this
> work!
>
> I'm wondering what vsthrottle's behaviour is when there's no memory
> available,
> specifically when tb_alloc() fails.
>
> From what I can understand from the code[1]:
>
>     b = tb_alloc(digest, limit, period, now);
>     AZ(VRB_INSERT(tbtree, &v->buckets, b));
>
> and tb_alloc() also checks for a non-zero malloc result (AN()).
>
> I understand we're talking about a remote possibility, and I see vsthrottle
> reclaims unused memory. However, when no memory is available for the
> malloc,
> will varnish leave a trace in syslog, exit and restart by way of the
> asserts?
>
> --
> Cosimo
>
> [1] https://github.com/varnish/varnish-modules/blob/master/
> src/vmod_vsthrottle.c#L126-L127
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20180411/a10ac132/attachment-0001.html>


More information about the varnish-misc mailing list