Updating VMODs with zero downtime

Carlos Abalde carlos.abalde at gmail.com
Mon Jul 28 17:11:21 CEST 2014

On 28 Jul 2014, at 12:21, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:

>> Lately I've been wondering about the possibility of updating Varnish 
>> VMODs with zero downtime. Being able of reloading VCL with zero downtime 
>> is a great Varnish Feature; it reminds me a lot to hot code replacement 
>> in Erlang, which is one of the killer features of the language. But what 
>> about VMODs? Is this an existing / planned feature? Any workarounds 
>> (apart from embedding all the VMOD logic in VCL using inline C code)?
> Just reload your VCL and the VMODs should be updated too.


I've been testing this today, both with Varnish Plus 3.0.3-6b280ef and Varnish Cache 3.0.5-1a89b1f, and using two newly installed VMs (CentOS 6.5 and Ubuntu Precise). I used the example VMOD as PoC (https://github.com/varnish/libvmod-example), and the VCL below:

    backend default {
      .host = "";
      .port = "9000";

    import example;

    sub vcl_recv {
      error 404;

    sub vcl_deliver {
      set resp.http.Test = example.hello("world");

    sub vcl_error {
      synthetic example.hello("world");
      return (deliver);

In all cases, any change in the VCL (i.e. replacing "world" by something else) was immediately reflected in Varnish once the service was reloaded. However, any change in the VMOD (i.e. replacing "Hello" by something else, followed by a compilation and installation of the VMOD), was not reflected when reloading the service. It only worked as expected after a restart of the service. 

Sounds this right to you? Am I missing something here?


Carlos Abalde.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20140728/ed929829/attachment.pgp>

More information about the varnish-misc mailing list