camscape - for excellent IT solutions - IT knowledge base

linux :: reload varnish

David G.
TitleReload Varnish
Tagsvarnish,reload,without restart
Desc.Reload varnish configuration without restart
CodeKBLN0043 v1.0
Date20 mai 2020

Restarting Varnish will cause losing of existing cache with, sometimes, huge impact on working site.


If you did some change in Varnish configuration, all you need is to reread the configuration, without restart.


Asume you run Varnish on on port 6082 (administrative port, not request port). Asume VCL config is in /etc/varnish/default.vcl


List existing configurations:


varnishadm -T vcl.list


will output:


available       0 boot
available     586 varnish_20200506
available       0 varnish_20200513
available       0 varnish_20200513-2
active        163 varnish_20200514


Now, reload configuration into a new entry:


varnishadm -T vcl.load varnish_newconfig20 /etc/varnish/default.vcl


and activate it:


varnishadm -T vcl.use varnish_newconfig20