Varnish 500's now not 302's

Hugues Alary hugues.alary at gmail.com
Mon May 14 03:11:22 CEST 2012


Are you specifically not caching 500 responses in your config file?
Something like:

if(beresp.status == 500)
{
   return (hit_for_pass);
}

If you're not doing that, then you *are* caching 500 responses.

On Sun, May 13, 2012 at 5:20 PM, <Nicholas_Maesepp at scee.net> wrote:

> Nothing special about my config file apart from the hashing of objects, I
> do have the following already in my vcl_fetch:
>
> set beresp.grace = 3m;
> if (beresp.status == 500) {
>     set beresp.saintmode = 5s;
>   }
>
> ======
> vcl_recv {
> set req.grace = 40s;
> if (req.request != "GET" && req.request != "HEAD") {
>          /* We only deal with GET and HEAD by default */
>          return (pass);
>      }
> if (req.http.Accept-Encoding && req.url ~ "\.(png|gif|jpg|swf|mov|flv)$") {
>         remove req.http.Accept-Encoding;
>   }
> return (lookup);
>
> I'm not convinced that I'm caching 500 responses on all these objects, I
> do wonder if its because I remove accept-encoding on those objects, those
> are the ones that end up with 500's. But also maybe my saintmode and grace
> numbers are too low if the back-end is infact serving 500's. But at least
> it's an avenue to explore and get some evidence to prove or disprove it.
> Will also try using hit for pass instead and see if that gives me more
> resilience.
>
>
> Cheers
>
> Nick
>
>
>
>
> From:        Hugues Alary <hugues.alary at gmail.com>
> To:        Andreas Plesner Jacobsen <apj at mutt.dk>
> Cc:        varnish-misc at varnish-cache.org
> Date:        05/12/2012 03:29 AM
> Subject:        Re: Varnish 500's now not 302's
> Sent by:        varnish-misc-bounces at varnish-cache.org
> ------------------------------
>
>
>
> At this point, sending your configuration file would maybe be a good idea.
>
> On May 11, 2012 1:41 AM, "Andreas Plesner Jacobsen" <*apj at mutt.dk*<apj at mutt.dk>>
> wrote:
> On Fri, May 11, 2012 at 09:30:52AM +1100, *Nicholas_Maesepp at scee.net*<Nicholas_Maesepp at scee.net>wrote:
>
> > I guess technically I realize this is from the cache, my question is more
> > along the lines of what could be causing my objects in the cache to
> become
> > stop being delivered as is and having a 500 error returned. Is my cache
> > being corrupted in some way when varnish starts to max out the malloc'ed
> > RAM? Seems like a bug to me but can't pinpoint exactly what causes it,
> > just that it happens after X amount of time to any of my instances.
>
> Then you misunderstood me. The 500 is a cached object that your backend
> served
> at the time. You can avoid caching such objects by inspecting the HTTP
> response
> in vcl_fetch and setting TTL and/or using hit for pass and/or saint mode.
>
> It's almost certainly not a bug.
>
> --
> Andreas
>
>
> *
> *
>
> *
> Sony Computer Entertainment Australia Pty Ltd*
> Level 1, 63-73 Ann Street Surry Hills NSW 2010
> P.O. Box 5023 Darlinghurst NSW 2010
> ph: +61 (0)2 9324 9500 fax: +61 (0)2 9324 9558
>
> *http://au.playstation.com* <http://au.playstation.com/>*
> **http://www.facebook.com/PlayStationAU*<http://www.facebook.com/PlaystationAU>
>
>
> *
> THE WORLD IS IN PLAY.*
> PlayStation®Vita has arrived.
> http://www.psvita.com
>
> *
> *[image: PSMOVE] <http://au.playstation.com/psvita>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify postmaster at scee.net
> This footnote also confirms that this email message has been checked for
> all known viruses.
> Sony Computer Entertainment Australia Pty. Limited
> Registered Office: Level 1, 63-73 Ann Street, Surry Hills, NSW 2010
> Australia
> Registered in Australia: 077 583 183
> **********************************************************************
> *
> Please consider the environment before printing this e-mail*
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



-- 
Hugues ALARY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120513/f3fdce4a/attachment.html>


More information about the varnish-misc mailing list