regsub(all?) input limit

Carlos Abalde carlos.abalde at gmail.com
Thu Dec 3 13:31:40 CET 2015


> On 03 Dec 2015, at 13:12, Christian Ruppert <idl0r at qasl.de> wrote:
> 
> Hi,
> 
> I just noticed that regsub and likely regsuball will just return the untouched input string if it exceeds 57118 bytes. Is it intended to do so, performance reasons perhaps?
> In this case it's a custom error page with some (eye candy) embedded images and in total a bit above the mentioned size. The regsub should actually just replace a pattern with the XID, in this case simply regsub(..., "bereq\.xid", bereq.xid).

Hi Christian,

You're probably hitting the workspace_client (or workspace_backend) limit. Those are varnishd parameters [1] that default to 64k. I've not checked the regsub implementation, but I guess it is not able to allocate enough memory in the workspace and in that case it simply returns the original input string (the alternative would be returning NULL or killing the child process in an assertion). Try to increase those parameters and try your test again.

[1] https://www.varnish-cache.org/docs/trunk/reference/varnishd.html#list-of-parameters

Best,

--
Carlos Abalde




More information about the varnish-misc mailing list