forget an object in vcl_fetch

David Birdsong david.birdsong at gmail.com
Fri Nov 13 19:12:21 CET 2009


On Fri, Nov 13, 2009 at 12:10 AM, David Birdsong
<david.birdsong at gmail.com> wrote:
> Is it possible to make varnish completely forget an object in
> vcl_fetch?  In thinking about a tiered setup, I'm trying to figure how
> I can capture the very tip of my traffic with a varnish running with
> abundant random read capacity and ethernet such that it never
> lru_nukes or expires an object which I've noticed can cause random
> read performance to plummet on the devices housing the storage file.
> (
>
> So say in a backend varnish I set a header when it's obj.hits >
> 100000.  The downstream varnish looks for this header, if it's not
> present it sets obj.cacheable to false in vcl_fetch.
>
> For example, upstream (closer to backend) varnish:
> sub vcl_deliver {
>  if (obj.hits > 100000 ) {
>    set resp.http.X-Super-Hot-File = "1";
>  }
>
> In the downstream (closer to client) varnish:
>
> sub vcl_fetch {
>  if (!beresp.X-Super-Hot-File) {
>    unset obj.cacheable;
>  }
> }
ok, i tried this and was not allowed to modify this attribute.

>
> or maybe instead ...
> sub vcl_fetch {
>  if (!beresp.X-Super-Hot-File) {
>   obj.ttl = 0s;
>  }
> }

this worked kept varnish from caching anything, but it didn't cut down
on disk hits.  i guess it's storing the object and something else
comes through and expires it.

just out of curiosity i tried 'pass' instead but that also caused disk
hits.  is there anyway to completely pass traffic through without
varnish storing it?

>
> Would this work?  Will this allow me to pass massive amounts of
> traffic through varnish without dirtying pages and in turn driving up
> iowait on slow devices that back the mmap'd storage file?
>



More information about the varnish-misc mailing list