Search code examples
varnishvarnish-vcl

Varnish has default limits for cache contents(URL + query string)'s length?


In the varnish log with varnishncsa, I found that the URL + query string parts seems truncated, like:

$ sudo varnishncsa -F "%U%q" | awk '{print $0,length}' > uq.vlen
(... few hours later within a host has a lot of traffics)
$ cat uq.vlen | sort -srn -k 2 | head -10
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
/<opaque_path>?<opaque_long_query_strings> 254
...

Is there a limit on URL + query string's length of varnish content?(default as 254?) Cannot find on documentations or in my vcl file(vcl 4.0) on that.


Solution

  • You are only hitting the log record limit vsl_reclen

    Use varnishadm param.set vsl_reclen X to increase it at runtime or the -p vsl_reclen=X command line argument to varnishd.

    If you need to go to particularly high values, consider to increase vsl_buffer also. If you do that, also increase workspace_client and workspace_backend by the same amount.