From uday.polu at indiamart.com Thu Oct 10 10:29:30 2024 From: uday.polu at indiamart.com (Uday Kumar) Date: Thu, 10 Oct 2024 15:59:30 +0530 Subject: Varnish Retry is not happening for some user requests (/GET) Message-ID: Hello All, We have configured varnish in such a way that if one of the backend returns *404 code*, varnish retries the request on another healthy backend. Varnish version: varnish-6.0.11 *Sample Configuration (default.vcl):* sub *vcl_backend_response *{ if (beresp.status == 404 { return(retry); } } But in some cases, varnish retry is not happening as expected. Upon analysis we have found the only difference in requests is *payload* *Examples:Request Pattern-1:* /GET Request URL HTTP Protocol Request Headers *Request-Pattern-2:* /GET Request URL HTTP Protocol Request Headers *payload* Please help us understand if there are any scenarios where varnish retries won't happen. *Thanks & Regards,* *Uday Kumar* -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.quintard at gmail.com Thu Oct 10 12:07:05 2024 From: guillaume.quintard at gmail.com (Guillaume Quintard) Date: Thu, 10 Oct 2024 21:07:05 +0900 Subject: Varnish Retry is not happening for some user requests (/GET) In-Reply-To: References: Message-ID: Hi Uday, Check your logs, it will probably tell you that the body was already consumed and for this reason it can't retry. If that's the case, check out https://varnish-cache.org/docs/trunk/reference/vmod_std.html#std-cache-req-body If not, please send us the complete logs (varnish -g request ...) and we'll look at it in greater details. Cheers, -- Guillaume Quintard On Thu, Oct 10, 2024 at 7:31?PM Uday Kumar wrote: > Hello All, > > We have configured varnish in such a way that if one of the backend > returns *404 code*, varnish retries the request on another healthy > backend. > Varnish version: varnish-6.0.11 > > *Sample Configuration (default.vcl):* > sub *vcl_backend_response *{ > if (beresp.status == 404 { > return(retry); > } > } > > But in some cases, varnish retry is not happening as expected. > > Upon analysis we have found the only difference in requests is *payload* > > > > *Examples:Request Pattern-1:* > /GET > Request URL > HTTP Protocol > Request Headers > > *Request-Pattern-2:* > /GET > Request URL > HTTP Protocol > Request Headers > *payload* > > Please help us understand if there are any scenarios where varnish retries > won't happen. > > *Thanks & Regards,* > *Uday Kumar* > _______________________________________________ > 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: From uday.polu at indiamart.com Thu Oct 10 13:57:18 2024 From: uday.polu at indiamart.com (Uday Kumar) Date: Thu, 10 Oct 2024 19:27:18 +0530 Subject: Varnish Retry is not happening for some user requests (/GET) In-Reply-To: References: Message-ID: Hi guillaume, Thanks, will check this and get back to you On Thu, Oct 10, 2024, 17:37 Guillaume Quintard wrote: > Hi Uday, > > Check your logs, it will probably tell you that the body was already > consumed and for this reason it can't retry. If that's the case, check out > https://varnish-cache.org/docs/trunk/reference/vmod_std.html#std-cache-req-body > > If not, please send us the complete logs (varnish -g request ...) and > we'll look at it in greater details. > > Cheers, > > -- > Guillaume Quintard > > > On Thu, Oct 10, 2024 at 7:31?PM Uday Kumar > wrote: > >> Hello All, >> >> We have configured varnish in such a way that if one of the backend >> returns *404 code*, varnish retries the request on another healthy >> backend. >> Varnish version: varnish-6.0.11 >> >> *Sample Configuration (default.vcl):* >> sub *vcl_backend_response *{ >> if (beresp.status == 404 { >> return(retry); >> } >> } >> >> But in some cases, varnish retry is not happening as expected. >> >> Upon analysis we have found the only difference in requests is *payload* >> >> >> >> *Examples:Request Pattern-1:* >> /GET >> Request URL >> HTTP Protocol >> Request Headers >> >> *Request-Pattern-2:* >> /GET >> Request URL >> HTTP Protocol >> Request Headers >> *payload* >> >> Please help us understand if there are any scenarios where varnish >> retries won't happen. >> >> *Thanks & Regards,* >> *Uday Kumar* >> _______________________________________________ >> 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: From uday.polu at indiamart.com Fri Oct 11 11:46:27 2024 From: uday.polu at indiamart.com (Uday Kumar) Date: Fri, 11 Oct 2024 17:16:27 +0530 Subject: Varnish Retry is not happening for some user requests (/GET) In-Reply-To: References: Message-ID: Hi Guillaume, We could not replicate the issue on test environment for requests with body version on test env: varnish-5.2.1 *[version on prod env: varnish-6.0.11]* Can this be because of the version? *Thanks & Regards,* *Uday Kumar* On Thu, Oct 10, 2024 at 7:27?PM Uday Kumar wrote: > Hi guillaume, > > Thanks, will check this and get back to you > > On Thu, Oct 10, 2024, 17:37 Guillaume Quintard < > guillaume.quintard at gmail.com> wrote: > >> Hi Uday, >> >> Check your logs, it will probably tell you that the body was already >> consumed and for this reason it can't retry. If that's the case, check out >> https://varnish-cache.org/docs/trunk/reference/vmod_std.html#std-cache-req-body >> >> If not, please send us the complete logs (varnish -g request ...) and >> we'll look at it in greater details. >> >> Cheers, >> >> -- >> Guillaume Quintard >> >> >> On Thu, Oct 10, 2024 at 7:31?PM Uday Kumar >> wrote: >> >>> Hello All, >>> >>> We have configured varnish in such a way that if one of the backend >>> returns *404 code*, varnish retries the request on another healthy >>> backend. >>> Varnish version: varnish-6.0.11 >>> >>> *Sample Configuration (default.vcl):* >>> sub *vcl_backend_response *{ >>> if (beresp.status == 404 { >>> return(retry); >>> } >>> } >>> >>> But in some cases, varnish retry is not happening as expected. >>> >>> Upon analysis we have found the only difference in requests is *payload* >>> >>> >>> >>> *Examples:Request Pattern-1:* >>> /GET >>> Request URL >>> HTTP Protocol >>> Request Headers >>> >>> *Request-Pattern-2:* >>> /GET >>> Request URL >>> HTTP Protocol >>> Request Headers >>> *payload* >>> >>> Please help us understand if there are any scenarios where varnish >>> retries won't happen. >>> >>> *Thanks & Regards,* >>> *Uday Kumar* >>> _______________________________________________ >>> 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: From martynas at atomgraph.com Wed Oct 23 12:26:51 2024 From: martynas at atomgraph.com (=?UTF-8?Q?Martynas_Jusevi=C4=8Dius?=) Date: Wed, 23 Oct 2024 14:26:51 +0200 Subject: Connection issues with Varnish Message-ID: Hi, I have code making a lot of PUT and POST requests to Varnish. I have noticed that quite a few of those fail due to a closed connection, and Apache HTTP Client hangs for a while (10-30s, sometimes more) around the same time. If I remove Varnish from the setup and write directly to the backend, the errors go away completely. So I'm confident the issue is Varnish-specific. The VCL is rather trivial and I don't think it's the core of the problem, but I cannot be sure. It can be found here: https://github.com/AtomGraph/LinkedDataHub/blob/develop/platform/varnish.vcl.template How would I go about debugging this? What should I look for in the logs? Your help is much appreciated. Best, Martynas From martynas at atomgraph.com Wed Oct 23 12:29:06 2024 From: martynas at atomgraph.com (=?UTF-8?Q?Martynas_Jusevi=C4=8Dius?=) Date: Wed, 23 Oct 2024 14:29:06 +0200 Subject: Connection issues with Varnish In-Reply-To: References: Message-ID: Forgot to mention: using varnish:7.3.0 Docker image. On Wed, Oct 23, 2024 at 2:26?PM Martynas Jusevi?ius wrote: > > Hi, > > I have code making a lot of PUT and POST requests to Varnish. > I have noticed that quite a few of those fail due to a closed > connection, and Apache HTTP Client hangs for a while (10-30s, > sometimes more) around the same time. > > If I remove Varnish from the setup and write directly to the backend, > the errors go away completely. So I'm confident the issue is > Varnish-specific. > > The VCL is rather trivial and I don't think it's the core of the > problem, but I cannot be sure. It can be found here: > https://github.com/AtomGraph/LinkedDataHub/blob/develop/platform/varnish.vcl.template > > How would I go about debugging this? What should I look for in the > logs? Your help is much appreciated. > > Best, > > Martynas From guillaume.quintard at gmail.com Wed Oct 23 15:59:39 2024 From: guillaume.quintard at gmail.com (Guillaume Quintard) Date: Wed, 23 Oct 2024 08:59:39 -0700 Subject: Connection issues with Varnish In-Reply-To: References: Message-ID: Hi Martynas, Can you start "varnishlog -g request", then try to send your failing request, and show us the logs? Kind regards, -- Guillaume Quintard On Wed, Oct 23, 2024 at 5:30?AM Martynas Jusevi?ius wrote: > Forgot to mention: using varnish:7.3.0 Docker image. > > On Wed, Oct 23, 2024 at 2:26?PM Martynas Jusevi?ius > wrote: > > > > Hi, > > > > I have code making a lot of PUT and POST requests to Varnish. > > I have noticed that quite a few of those fail due to a closed > > connection, and Apache HTTP Client hangs for a while (10-30s, > > sometimes more) around the same time. > > > > If I remove Varnish from the setup and write directly to the backend, > > the errors go away completely. So I'm confident the issue is > > Varnish-specific. > > > > The VCL is rather trivial and I don't think it's the core of the > > problem, but I cannot be sure. It can be found here: > > > https://github.com/AtomGraph/LinkedDataHub/blob/develop/platform/varnish.vcl.template > > > > How would I go about debugging this? What should I look for in the > > logs? Your help is much appreciated. > > > > Best, > > > > Martynas > _______________________________________________ > 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: