Bad times in client but not backend side for not cached request
Guillaume Quintard
guillaume at varnish-software.com
Fri May 17 14:34:23 UTC 2019
Hi,
Is the ttl <= 0 when you return from vcl_backend_reponse? It looks like you
are telling varnish to cache, for 0 seconds.
The result is that it'll coalesce requests, but at the same time, can't
reuse the responses, so the backend requests are just serialized.
You have two ways to deal with that:
- if you know in vcl_recv that the request isn't cacheable, return(pass).
- if you discover the uncacheability in vcl_backend_response, set a
positive ttl, and set beresp.uncacheable to true. This will tell varnish to
remember to non coalesce requests for this object for the duration of the
ttl.
Note that this is already done in the built-in.vcl (
https://github.com/varnishcache/varnish-cache/blob/master/bin/varnishd/builtin.vcl)
that gets appended to your code when you load a vcl. However this only gets
executed if you don't return from the routine yourself.
Hope that helps,
On Fri, May 17, 2019, 05:03 Rodrigo García Suárez <
rodrigo.garcia at the-cocktail.com> wrote:
> Hello everybody.
>
> I have this weird issue with Varnish 5.0.0 on Debian 9.4 and maybe
> somebody here can help me with it.
>
> The thing is, I have this request:
>
>
> https://somehost.com//cart/current_cart.json?clear_cart=false&_=1550491039254
>
> It is always a miss in varnish (as it should be) and making only one,
> works just fine.
>
> But doing some performance testing the response times increases quickly.
> For example, with 2 requests/s, after 4 or 5 request, the response time
> begins to increase exponentially and after 20 request I have 11s of
> latency, reaching 40s after 40 requests.
>
> If I take out Varnish (sending the request from nginx to the app) it works
> just fine. And looking at the varnish log, the "%T" format option in the
> backend log keeps a response <=1s but in the client side I see the
> incremental reponse times.
>
> The request can't be cached so now I am keeping it out from varnish but I
> don't like the idea of this exception in the configuration and I am worry
> it could reproduce with other requests (in fact I have two other suspects)
> so any idea or suggestion will be greatly appreciated.
>
> Thanks for your time.
>
>
> --
> Rodrigo García Suárez
> rodrigo.garcia at the-cocktail.com
> 679 141 132
>
> The Cocktail
> c/ Salamanca 17
> 28020 Madrid
> (+34) 915 670 605
>
> www > http://the-cocktail.com
>
> Este mensaje se dirige exclusivamente a su destinatario. Puede contener
> información confidencial sometida a secreto profesional o cuya divulgación
> esté prohibida, en virtud de la legislación vigente. No está permitida su
> divulgación, copia o distribución a terceros sin la autorización previa y
> por escrito de The Cocktail. Si ha recibido este mensaje por error, le
> rogamos nos lo comunique inmediatamente por esta misma vía y proceda a su
> destrucción.
>
> This message is intended exclusively for the individual or entity to which
> it is addressed and may contain confidential or legally privileged
> information, which may not be disclosed under current legislation. Any form
> of disclosure, copying or distribution of this message is strictly
> prohibited, save with written authorization from The Cocktail. If you have
> received this message in error, please notify the sender immediately by
> this way and delete all copies of the message.
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20190517/00405556/attachment.html>
More information about the varnish-misc
mailing list