Re: Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
Just to explain my concern a bit. The worst case scenario in production, that I very much would like to avoid, could look something like this: 1. Something happens with our public key, so that Varnish won't be able to start after getting the new faulty key. Already running servers will continue

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
> https://github.com/nigoroll/libvmod-dynamic/blob/master/src/vmod_dynamic.vcc#L538-L583 > maybe? > > I'm sure Nils will pipe up here if you need help, and if you want more > synchronous assistance, there's always the discord channel > . Thanks! :)

Re: Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
> It's the VMOD author you should ask to have an option to ignore public > key errors. Well, I'm usually of the mindset that if a problem can be handled in a generic way by the language/platform/framework, then one should avoid requiring each and every custom vmod/plugin/library to handle it

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
> It was back-ported to 6.0, which is not an LTS branch limited to bug fixes ;) > > https://varnish-cache.org/docs/6.0/users-guide/vcl-backends.html Thanks! Wow, I can't believe that I could miss that. I thought I read that specific page, as well as searched on Google, but I guess I was too

Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
Hi, We use the vmod crypto to verify cryptographic signatures for some of our traffic. When testing, the public key was hard coded in the VCL, but before we start using this feature in production we will switch to reading the public key from a file on disk. This file is generated on server

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
les. From: Guillaume Quintard Sent: Wednesday, April 19, 2023 4:42 PM To: Batanun B Cc: varnish-misc@varnish-cache.org Subject: Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs The fact the IPs are identical is we

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
> backend theBackend none; > Here's the relevant documentation: > https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html#the-none-backend > It was added in 6.4. Look like exactly what we need! Sadly we are "stuck" on 6.0 until the next LTS version comes. So I think that until then I

Re: Strange Broken Pipe error from Varnish health checks

2023-04-19 Thread Batanun B
Couldn't a HEAD request solve this? Then nginx wouldn't bother with the body at all, right? This is what we do with our health checks. For example: backend someBackend { .host = "[redacted]"; .port = "80"; .probe = { .interval = 9s; .request = "HEAD

Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
All of the sudden Varnish fails to start in my development environment, and gives me the following error message: Message from VCC-compiler: Backend host "redacted-hostname": resolves to too many addresses. Only one IPv4 and one IPv6 are allowed. Please specify which exact address you want to

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
Hi Guillaume, > I'm curious, if it's completely deactivated what's the benefit of having it > in the vcl? It is only intended to be deactivated in production (until we go live). Our test and staging environments have the backend active. > if (false) { >   set req.backend_hint =

Possible to disable/inactivate a backend using VCL?

2023-04-14 Thread Batanun B
Hi, We are currently working on a new feature that won't go live for several months still. This new feature has it's own backend in Varnish. Most of our VCL code is identical for all environments, and this code refers to the new backend, so it needs to be defined otherwise Varnish won't start.

Re: Confusion about LTS versions. Any comprehensive documentation regarding everything LTS?

2022-03-02 Thread Batanun B
Hi Guillaume, Well, not really. It is a snapshot of the state almost two years ago, and I expected some page where the information is kept up-to-date. And LTS is only mentioned two times in that email, not answering any of my LTS questions. Is there an up-to-date list of _all_ LTS versions

Confusion about LTS versions. Any comprehensive documentation regarding everything LTS?

2022-03-02 Thread Batanun B
Hi, Is there any documentation focused on the LTS versions of Varnish Cache? And with that I mean things like "What does the LTS version of Varnish mean?", "Why should or shouldn't I choose an LTS version?", "What is the latest LTS version?" and "How do I install an LTS version?". Currently I

Re: Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

2021-12-17 Thread Batanun B
> I'd suggest to determine the correct delivery of the front page via an > external monitoring > (e.g. icinga2 or a simple script). As far as I understand, you don't need to > know the exact request, but more of a rough point in time of when the requests > start failing. So a monitoring script

Re: Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

2021-12-17 Thread Batanun B
> I recommend permanent logging, if you want to be able to debug older > incidents. > We do it like this: > > ``` > /usr/bin/varnishlog -w /var/log/varnish/varnish-500.log -a -D \ > -P /var/run/varnishlog-500.pid \ > -q 'RespStatus >= 500 or BerespStatus >=500' > ``` > > I

Re: Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

2021-12-17 Thread Batanun B
> Easy one: you build the key from the request, while the vary header is a > response property. Therefore, Varnish can't know to put the varied headers > into the hash, because it doesn't have that information yet. Of course! Makes perfect sense. But the documentation should make this crystal

Re: Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

2021-12-16 Thread Batanun B
> Could be a vary issue Ah, I remember hearing about that earlier, and made a mental note to read up on that. But I forgot all about it. Now I did just that, and boy was that a cold shower for me! I definitely need to unset that header. But why, for the love of all that is holy, does Varnish

Varnish returning synthetic 500 error even though it has stale content it should serve. But only seems to happen during/after a burst of traffic

2021-12-16 Thread Batanun B
Hi, One of our websites usually has quite a low but steady stream of visitors, but occationally we get a sudden surge of requests over a very short time period (about 1-2 minutes). Varnish seems to handle the load fine, but the backends struggle with this. But I have noticed that Varnish

Keeping multiple cookies based on regex or prefix, with Varnish 6.0

2021-11-15 Thread Batanun B
Hi, We use Varnish Cache 6.0 LTS, with varnish modules 0.15.0. As far as I can see, this includes a version of the cookie vmod that doesn't support regex. Yet, our use case leans towards using a regex, or at least a substring. Case in point. Our frontend uses a bunch of cookies. And a handful

Re: Can't get "streaming" or pipe to work, Varnish still waits for the full response

2020-09-14 Thread Batanun B
min pages. From: Dridi Boukelmoune Sent: Monday, September 14, 2020 8:35 AM To: Batanun B Cc: varnish-misc@varnish-cache.org Subject: Re: Can't get "streaming" or pipe to work, Varnish still waits for the full response On Sat, Sep 12, 2020 at 10:08

Can't get "streaming" or pipe to work, Varnish still waits for the full response

2020-09-12 Thread Batanun B
Hi, We have some old (legacy) internal admin pages that do some classic old school processing while the page is loading, and outputting the current status as it is working. When requesting these pages directly (through Tomcat), I can see the results in the browser at the same time as the

Re: Possible to detect a previous xkey softpurge?

2020-09-12 Thread Batanun B
> Arguably, if you use Varnish to cache responses, you might as well > always tell your backend not to serve from cache. Because if a soft > purge moves you inside the grace period, there's no guarantee that the > next hit will happen before the object leaves the grace period. At > this point this

Re: Possible to detect a previous xkey softpurge?

2020-09-12 Thread Batanun B
> From what I understand now, you want to make sure that after a softpurge, > you never get the stale object. So, if I may: why use a softpurge at all? > Just remove the objects completely and be done with it. I think I was not explaining my use case properly. It is not the Varnish cache I

Re: Possible to detect a previous xkey softpurge?

2020-09-03 Thread Batanun B
Hi, I'm not sure how that "no-grace" header would be set. The softpurge could theoretically impact hundred of URLs, and what we would like is that any requests for these URLs after the softpurge should include a special header when talking with the backend. Skipping grace in general, and

Possible to detect a previous xkey softpurge?

2020-09-03 Thread Batanun B
Hi, We sometimes have a problem with the backend using its internal cache for a few seconds too long after something has been updated. We trigger a softpurge (xkey vmod) in varnish, but if someone requests the page again very soon after that, the data that Varnish gets from the backend might

Re: Using user defined variable in backend definition?

2020-08-26 Thread Batanun B
Thanks for the suggestions! I'm not sure if we are in the right moment of this project to introduce more competitivity in the form of switching to directors, and a dynamic on top of that. At least not just for this simple thing. But we might need/want to use directors later on, for the dynamic

Using user defined variable in backend definition?

2020-08-24 Thread Batanun B
Hi, I'm experimenting with user defined variables, and when using them in regular string concatenation, and in synch output, it works fine. But I would like to use them in the backend definitions, and I simply can't get it to work. backend myBackend { .host = var.get("myBackendHost"); }

Detect request coalescing?

2020-07-30 Thread Batanun B
Just a quick question that I wasn't able to find any information on using regular google searches. Is it possible to detect request coalescing somehow? Meaning that, when looking at the response headers, can I somehow see that the request had to wait for another request for the same resource to

Re: Varnish intermittently returns incomplete images

2020-05-08 Thread Batanun B
20 7:34 PM To: Batanun B Cc: varnish-misc@varnish-cache.org Subject: Re: Varnish intermittently returns incomplete images Hi, Do you have objects that are sensibly smaller that your images in your cache? What you are describing sounds like LRU failure (check nuke_limit in "varnis

Varnish intermittently returns incomplete images

2020-05-08 Thread Batanun B
Our Varnish (test environment) intermittently returns incomplete images. So the binary content is not complete. When requesting the image from the backend directly (using curl), the complete image is returned every time (I tested 1000 times using a script). This happens intermittently.

Re: Grace and misbehaving servers

2020-03-25 Thread Batanun B
On Mo, Mar 23, 2020 at 10:00 AM Dridi Boukelmoune wrote: > > For starters, there currently is no way to know for sure that you > entered vcl_synth because of a return(abandon) transition. There are > plans to make it possible, but currently you can do that with > confidence lower than 100%. I

Re: Fix incorrect Last-Modified from backend?

2020-03-20 Thread Batanun B
On Thu, Mar 19, 2020 at 09:57 AM Dridi Boukelmoune wrote: > > By the way, when it comes to revalidation based on the body, you > should use ETag instead of Last-Modified. Sadly, there is no ETag available. And I can't see any way of adding it without "hacking" the software (patching their code

Re: Grace and misbehaving servers

2020-03-20 Thread Batanun B
On Thu , Mar 19, 2020 at 11:12 AM Dridi Boukelmoune wrote: > > Not quite! > > ttl+grace+keep defines how long an object may stay in the cache > (barring any form of invalidation). > > The grace I'm referring to is beresp.grace, Well, when I wrote "if ttl + grace + keep is a low value set in

Fix incorrect Last-Modified from backend?

2020-03-18 Thread Batanun B
Hi, Long story short, one of our backend systems serves an incorrect Last-Modified response header, and I don't see a way to fix it at the source (third party system, not based on Nginx/Tomcat/IIS or anything like that). So, I would like to "fix" it in Varnish, since I don't expect the maker

Re: Grace and misbehaving servers

2020-03-17 Thread Batanun B
Hi Dridi, On Monday, March 16, 2020 9:58 AM Dridi Boukelmoune wrote: > Not really, it's actually the other way around. The beresp.grace > variable defines how long you may serve an object past its TTL once it > enters the cache. > > Subsequent requests can then limit grace mode, so think of