Upgrading to Varnish 6.2¶
VCL¶
VCL programs for Varnish 6.1 can be expected to run without changes in the new version.
A VCL load will now issue a warning, but does not fail as previously,
if a backend declaration uses the .path
field to specify a Unix
domain socket, but the socket file does not exist or is not accessible
at VCL load time. This makes it possible to start the peer component
listening at the socket, or set its permissions, after Varnish starts
or the VCL is loaded. Backend fetches fail if the socket is not
accessible by the time the fetch is attempted.
return(miss)
from vcl_hit{}
is now removed. An option for
implementing similar functionality is:
return (restart)
fromvcl_hit{}
in
vcl_recv{}
for the restart (whenreq.restarts
has increased),set req.hash_always_miss = true;
.
Runtime parameters¶
Some varnishd -p
parameters that have been deprecated for some
time have been removed. If you haven’t changed them yet, you have to
now. These are:
shm_reclen
– use vsl_reclen insteadvcl_dir
– use vcl_path insteadvmod_dir
– use vmod_path instead
The default value of thread_pool_stack has been increased from 48k to 56k on 64-bit platforms and to 52k on 32-bit platforms. See the discussion under Parameters in Changes in Varnish 6.2 for details.
Type conversion functions in VMOD std¶
The existing type-conversion functions in VMOD std - Varnish Standard Module have been reworked to make them more flexible and easier to use. These functions now also accept suitable numeral or quantitative arguments.
DURATION duration([STRING s], [DURATION fallback], [REAL real], [INT integer])
BYTES bytes([STRING s], [BYTES fallback], [REAL real], [INT integer])
TIME time([STRING s], [TIME fallback], [REAL real], [INT integer])
These type-conversion functions should be fully backwards compatible, but the following differences should be noted:
The fallback is not required anymore. A conversion failure in the absence of a fallback argument will now trigger a VCL failure.
A VCL failure will also be triggered if no or more than one argument (plus optional fallback) is given.
Conversion functions now only ever truncate if necessary (instead of rounding).
REAL round(REAL r) has been added for explicit rounding.
The following functions are deprecated and should be replaced by the new conversion functions:
They will be removed in a future version of Varnish.
varnishadm and the CLI¶
The -j
option for JSON output has been added to a number of
commands, see JSON output in
Changes in Varnish 6.2 and varnish-cli. We
recommend the use of JSON format for automated parsing of CLI
responses (varnishadm output).
Listing backends¶
backend.list
has grown an additional column, the output has
changed and fields are now of dynamic width:
The
Admin
column now accurately statesprobe
only if a backend has some means of dynamically determining health state.The
Probe
column has been changed to displayX/Y
, where:Integer
X
is the number of good probes in the most recent window; or if the backend in question is a director, the number of healthy backends accessed via the director or any other director-specific metric.Integer
Y
is the window in which the threshold for overall health of the backend is defined (from the.window
field of a probe, see VCL); or in the case of a director, the total number of backends accessed via the director or any other director-specific metric.
If there is no probe or the director does not provide details,
0/0
is output.The
Health
column has been added to contain the dynamic (probe) health state and the format has been unified to justhealthy
orsick
.If there is no probe,
Health
is always given ashealthy
. Notice that the administrative health as shown in theAdmin
column has precedence.
In the probe_message
field of backend.list -j
output, the
Probe
and Health
columns appear as the array [X, Y,
health]
.
See varnish-cli for details.
Listing VCLs¶
The non-JSON output of vcl.list
has been changed:
The
state
andtemperature
fields appear in separate columns (previously combined in one column).The optional column showing the relationships between labels and VCL configurations (when labels are in use) has been separated into two columns.
See varnish-cli for details. In the JSON output for
vcl.list -j
, this information appears in separate fields.
The width of columns in backend.list
and vcl.list
output
(non-JSON) is now dynamic, to fit the width of the terminal window.