From tranxene50 at openvz-diff-backups.fr Sun Jun 14 02:31:46 2020 From: tranxene50 at openvz-diff-backups.fr (tranxene50) Date: Sun, 14 Jun 2020 04:31:46 +0200 Subject: Caching OSM tiles - how to not overload backends? Message-ID: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> Hello! Please forgive my bad English, I live in France. Summary: how to cache - with Varnish - Open Street Map PNG images without overloading OSM tiles servers? The question seems related to Varnish backends and ".max_connections" parameter. A far as I know, if ".max_connections" is reached for a backend, Varnish sends 503 http errors. I understand the logic but would it be possible to queue these incoming requests and wait until the selected backend is really available? backend a_tile????????????????? { ? .host???????????????????????? = "a.tile.openstreetmap.org"; ? .port???????????????????????? = "80"; ? .max_connections????????????? = 2; } If Varnish have, let's say 100 incoming requests in 1 second, how can I handle this "spike" without overloading the backend? All my google searches were "dead ends" so I think the question is poorly formulated. Note 1 : using [random|round_robin] directors could be a temporary solution Note 2 : libvmod-dynamic is great but does not limit backend simultaneous connexions Many thanks for your help! -- tranxene50 tranxene50 at openvz-diff-backups.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: From info+varnish at shee.org Mon Jun 15 12:28:42 2020 From: info+varnish at shee.org (info+varnish at shee.org) Date: Mon, 15 Jun 2020 14:28:42 +0200 Subject: varnish node without gcc Message-ID: <08628336a17c60faf98a8b4e6464b3f63cc85f30.camel@shee.org> Hi, is it possible to compile the final merged vcl configuration in a pre step and then pushing it to the frontend nodes? So, no vcl config and gcc on the frontend. Just a bin blob and a restart of the service. Can this "compile while restart" activity splitted into to seprated ones? Is that possible? -- Thanks, Leon From dridi at varni.sh Mon Jun 15 13:24:41 2020 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 15 Jun 2020 13:24:41 +0000 Subject: varnish node without gcc In-Reply-To: <08628336a17c60faf98a8b4e6464b3f63cc85f30.camel@shee.org> References: <08628336a17c60faf98a8b4e6464b3f63cc85f30.camel@shee.org> Message-ID: On Mon, Jun 15, 2020 at 12:29 PM wrote: > > Hi, > > is it possible to compile the final merged vcl configuration in a pre > step and then pushing it to the frontend nodes? So, no vcl config and > gcc on the frontend. Just a bin blob and a restart of the service. It is technically possible to pass a blob around, but Varnish insists on compiling VCL locally. > Can this "compile while restart" activity splitted into to seprated > ones? Is that possible? There is no restart involved, VCL is meant to be loadable on the fly. Dridi From guillaume at varnish-software.com Mon Jun 15 14:46:08 2020 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 15 Jun 2020 07:46:08 -0700 Subject: varnish node without gcc In-Reply-To: References: <08628336a17c60faf98a8b4e6464b3f63cc85f30.camel@shee.org> Message-ID: Hi, Just to add a detail here, you can have a look at "varnishadm param.show cc_command" to see how varnish transforms the C into a shared object. -- Guillaume Quintard On Mon, Jun 15, 2020 at 6:26 AM Dridi Boukelmoune wrote: > On Mon, Jun 15, 2020 at 12:29 PM wrote: > > > > Hi, > > > > is it possible to compile the final merged vcl configuration in a pre > > step and then pushing it to the frontend nodes? So, no vcl config and > > gcc on the frontend. Just a bin blob and a restart of the service. > > It is technically possible to pass a blob around, but Varnish insists > on compiling VCL locally. > > > Can this "compile while restart" activity splitted into to seprated > > ones? Is that possible? > > There is no restart involved, VCL is meant to be loadable on the fly. > > Dridi > _______________________________________________ > 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 dridi at varni.sh Mon Jun 15 18:00:05 2020 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 15 Jun 2020 18:00:05 +0000 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> Message-ID: On Sun, Jun 14, 2020 at 2:32 AM tranxene50 wrote: > > Hello! > > Please forgive my bad English, I live in France. > > Summary: how to cache - with Varnish - Open Street Map PNG images without overloading OSM tiles servers? > > The question seems related to Varnish backends and ".max_connections" parameter. > > A far as I know, if ".max_connections" is reached for a backend, Varnish sends 503 http errors. > > I understand the logic but would it be possible to queue these incoming requests and wait until the selected backend is really available? > > backend a_tile { > .host = "a.tile.openstreetmap.org"; > .port = "80"; > .max_connections = 2; > } > > If Varnish have, let's say 100 incoming requests in 1 second, how can I handle this "spike" without overloading the backend? > > All my google searches were "dead ends" so I think the question is poorly formulated. > > Note 1 : using [random|round_robin] directors could be a temporary solution > Note 2 : libvmod-dynamic is great but does not limit backend simultaneous connexions > > Many thanks for your help! Bonsoir, Unfortunately we don't have any sort of queuing on the backend side, so besides implementing your own backend transport from scratch in a VMOD there is currently no solution. Cordialement, Dridi From xavier at ccmbenchmark.com Mon Jun 15 22:17:12 2020 From: xavier at ccmbenchmark.com (Xavier Leune) Date: Tue, 16 Jun 2020 00:17:12 +0200 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> Message-ID: Hello, @tranxene50 if implementing a vmod can be very challenging, using haproxy can be a great solution here. Please refer to this blog post: https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/ (or in french ;) https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/ ). The very first step is about setting a maximum connections number and a queuing. Using haproxy as your backend would require low engineering and a minimum overage. Regards, Le lun. 15 juin 2020 ? 20:02, Dridi Boukelmoune a ?crit : > On Sun, Jun 14, 2020 at 2:32 AM tranxene50 > wrote: > > > > Hello! > > > > Please forgive my bad English, I live in France. > > > > Summary: how to cache - with Varnish - Open Street Map PNG images > without overloading OSM tiles servers? > > > > The question seems related to Varnish backends and ".max_connections" > parameter. > > > > A far as I know, if ".max_connections" is reached for a backend, Varnish > sends 503 http errors. > > > > I understand the logic but would it be possible to queue these incoming > requests and wait until the selected backend is really available? > > > > backend a_tile { > > .host = "a.tile.openstreetmap.org"; > > .port = "80"; > > .max_connections = 2; > > } > > > > If Varnish have, let's say 100 incoming requests in 1 second, how can I > handle this "spike" without overloading the backend? > > > > All my google searches were "dead ends" so I think the question is > poorly formulated. > > > > Note 1 : using [random|round_robin] directors could be a temporary > solution > > Note 2 : libvmod-dynamic is great but does not limit backend > simultaneous connexions > > > > Many thanks for your help! > > Bonsoir, > > Unfortunately we don't have any sort of queuing on the backend side, > so besides implementing your own backend transport from scratch in a > VMOD there is currently no solution. > > Cordialement, > Dridi > _______________________________________________ > 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 tranxene50 at openvz-diff-backups.fr Tue Jun 16 22:21:22 2020 From: tranxene50 at openvz-diff-backups.fr (tranxene50) Date: Wed, 17 Jun 2020 00:21:22 +0200 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> Message-ID: <3be01b29-b704-3af2-57a9-2e071f1170e0@openvz-diff-backups.fr> Hello! Many thanks for your answers! :-) @Dridi: You are right, writing a specific VMOD would be the ideal solution but unfortunately I am not qualified for the job. ^^ By the way, I would like to thank all the people who are working hard to enhance and maintain Varnish. This software is absolutely awesome! @Xavier: Before considering HAProxy, I searched if quick and dirty hacks were possible with iptables to limit simultaneous connexions and tc to shape the traffic. But, after a quick reading of the documentation of HAProxy, it became clear that - as you said - it is a reliable solution. So, thanks the for the hint! Have a great day! Le 16/06/2020 ? 00:17, Xavier Leune a ?crit?: > Hello, > > @tranxene50 if implementing a vmod can be very challenging, using > haproxy can be a great solution here. Please refer to this blog post: > https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?(or > in french ;) > https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?). > The very first step is about setting a maximum connections number and > a queuing. Using haproxy as your backend would require low engineering > and a minimum overage. > > Regards, > > Le?lun. 15 juin 2020 ??20:02, Dridi Boukelmoune a ?crit?: > > > Bonsoir, > > Unfortunately we don't have any sort of queuing on the backend side, > so besides implementing your own backend transport from scratch in a > VMOD there is currently no solution. > > Cordialement, > Dridi > > On Sun, Jun 14, 2020 at 2:32 AM tranxene50 > > wrote: > > > > Hello! > > > > Please forgive my bad English, I live in France. > > > > Summary: how to cache - with Varnish - Open Street Map PNG > images without overloading OSM tiles servers? > > > > The question seems related to Varnish backends and > ".max_connections" parameter. > > > > A far as I know, if ".max_connections" is reached for a backend, > Varnish sends 503 http errors. > > > > I understand the logic but would it be possible to queue these > incoming requests and wait until the selected backend is really > available? > > > > backend a_tile? ? ? ? ? ? ? ? ? { > >? ?.host? ? ? ? ? ? ? ? ? ? ? ? ?= "a.tile.openstreetmap.org > "; > >? ?.port? ? ? ? ? ? ? ? ? ? ? ? ?= "80"; > >? ?.max_connections? ? ? ? ? ? ? = 2; > > } > > > > If Varnish have, let's say 100 incoming requests in 1 second, > how can I handle this "spike" without overloading the backend? > > > > All my google searches were "dead ends" so I think the question > is poorly formulated. > > > > Note 1 : using [random|round_robin] directors could be a > temporary solution > > Note 2 : libvmod-dynamic is great but does not limit backend > simultaneous connexions > > > > Many thanks for your help! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwetzel at atanar.com Wed Jun 17 13:08:29 2020 From: dwetzel at atanar.com (Damien Wetzel) Date: Wed, 17 Jun 2020 15:08:29 +0200 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: <3be01b29-b704-3af2-57a9-2e071f1170e0@openvz-diff-backups.fr> References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> <3be01b29-b704-3af2-57a9-2e071f1170e0@openvz-diff-backups.fr> Message-ID: <24298.5581.636830.385652@blackcube.at.myplace> Hi Tranx?ne50 I'm a reseller of Fastly in France a cdn based on a fork of varnish 2 maybe it could be a solution to minimize the backend traffic you receive somehow ? i can make you test if needed akamai has a solution they call waiting room, to regulate the traffic to the origin, i think this is the kind of things to try to achieve ? Best Regards, Damien tranxene50 writes: > Hello! > > Many thanks for your answers! :-) > > @Dridi: > > You are right, writing a specific VMOD would be the ideal solution but unfortunately I am not qualified for the job. ^^ > > By the way, I would like to thank all the people who are working hard to enhance and maintain Varnish. > > This software is absolutely awesome! > > @Xavier: > > Before considering HAProxy, I searched if quick and dirty hacks were possible with iptables to limit simultaneous connexions and tc to shape the traffic. > > But, after a quick reading of the documentation of HAProxy, it became clear that - as you said - it is a reliable solution. > > So, thanks the for the hint! > > Have a great day! > > Le 16/06/2020 ? 00:17, Xavier Leune a ?crit?: > > Hello, > > @tranxene50 if implementing a vmod can be very challenging, using haproxy can be a great solution here. Please refer to this blog post:? > https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?(or in french ;)?https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?). The very first step is about setting a > maximum connections number and a queuing. Using haproxy as your backend would require low engineering and a minimum overage. > > Regards, > > Le?lun. 15 juin 2020 ??20:02, Dridi Boukelmoune a ?crit?: > > Bonsoir, > > Unfortunately we don't have any sort of queuing on the backend side, > so besides implementing your own backend transport from scratch in a > VMOD there is currently no solution. > > Cordialement, > Dridi > > On Sun, Jun 14, 2020 at 2:32 AM tranxene50 > wrote: > > > > Hello! > > > > Please forgive my bad English, I live in France. > > > > Summary: how to cache - with Varnish - Open Street Map PNG images without overloading OSM tiles servers? > > > > The question seems related to Varnish backends and ".max_connections" parameter. > > > > A far as I know, if ".max_connections" is reached for a backend, Varnish sends 503 http errors. > > > > I understand the logic but would it be possible to queue these incoming requests and wait until the selected backend is really available? > > > > backend a_tile? ? ? ? ? ? ? ? ? { > >? ?.host? ? ? ? ? ? ? ? ? ? ? ? ?= "a.tile.openstreetmap.org"; > >? ?.port? ? ? ? ? ? ? ? ? ? ? ? ?= "80"; > >? ?.max_connections? ? ? ? ? ? ? = 2; > > } > > > > If Varnish have, let's say 100 incoming requests in 1 second, how can I handle this "spike" without overloading the backend? > > > > All my google searches were "dead ends" so I think the question is poorly formulated. > > > > Note 1 : using [random|round_robin] directors could be a temporary solution > > Note 2 : libvmod-dynamic is great but does not limit backend simultaneous connexions > > > > Many thanks for your help! > > > ---------------------------------------------------------------------- > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damien WETZEL (ATANAR TECHNOLOGIES) ("`-/")_.-'"``-._ http://www.atanar.com . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' Phone:+33 9 67 35 09 05 _.- _..-_/ / ((.' - So much to do, so little time - ((,.-' ((,/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From tranxene50 at openvz-diff-backups.fr Wed Jun 17 14:23:15 2020 From: tranxene50 at openvz-diff-backups.fr (tranxene50) Date: Wed, 17 Jun 2020 16:23:15 +0200 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: <24298.5581.636830.385652@blackcube.at.myplace> References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> <3be01b29-b704-3af2-57a9-2e071f1170e0@openvz-diff-backups.fr> <24298.5581.636830.385652@blackcube.at.myplace> Message-ID: Hello Damien. Thank you for your proposal, I appreciate! But, as I can see/read, Fastly operates the same way as Varnish when the backend is overloaded (it rejects new connections): https://docs.fastly.com/en/guides/common-503-errors#error-503-backendmax_conn-reached The "Waiting room" could be an option (but this is not what I try to achieve because it throttles clients): https://developer.fastly.com/solutions/patterns/waiting-room/ However, I prefer to stick to GPL or Open-Source projects and HAProxy seems perfect to regulate the traffic sent to the backend. ;-) Regards. Le 17/06/2020 ? 15:08, Damien Wetzel a ?crit?: > Hi Tranx?ne50 > I'm a reseller of Fastly in France a cdn based on a fork of varnish 2 > maybe it could be a solution to minimize the backend traffic you receive somehow ? > i can make you test if needed > akamai has a solution they call waiting room, to regulate the traffic to the origin, > i think this is the kind of things to try to achieve ? > Best Regards, > Damien > > tranxene50 writes: > > Hello! > > > > Many thanks for your answers! :-) > > > > @Dridi: > > > > You are right, writing a specific VMOD would be the ideal solution but unfortunately I am not qualified for the job. ^^ > > > > By the way, I would like to thank all the people who are working hard to enhance and maintain Varnish. > > > > This software is absolutely awesome! > > > > @Xavier: > > > > Before considering HAProxy, I searched if quick and dirty hacks were possible with iptables to limit simultaneous connexions and tc to shape the traffic. > > > > But, after a quick reading of the documentation of HAProxy, it became clear that - as you said - it is a reliable solution. > > > > So, thanks the for the hint! > > > > Have a great day! > > > > Le 16/06/2020 ? 00:17, Xavier Leune a ?crit?: > > > > Hello, > > > > @tranxene50 if implementing a vmod can be very challenging, using haproxy can be a great solution here. Please refer to this blog post: > > https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?(or in french ;)?https://www.haproxy.com/fr/blog/four-examples-of-haproxy-rate-limiting/?). The very first step is about setting a > > maximum connections number and a queuing. Using haproxy as your backend would require low engineering and a minimum overage. > > > > Regards, > > > > Le?lun. 15 juin 2020 ??20:02, Dridi Boukelmoune a ?crit?: > > > > Bonsoir, > > > > Unfortunately we don't have any sort of queuing on the backend side, > > so besides implementing your own backend transport from scratch in a > > VMOD there is currently no solution. > > > > Cordialement, > > Dridi > > > > On Sun, Jun 14, 2020 at 2:32 AM tranxene50 > > wrote: > > > > > > Hello! > > > > > > Please forgive my bad English, I live in France. > > > > > > Summary: how to cache - with Varnish - Open Street Map PNG images without overloading OSM tiles servers? > > > > > > The question seems related to Varnish backends and ".max_connections" parameter. > > > > > > A far as I know, if ".max_connections" is reached for a backend, Varnish sends 503 http errors. > > > > > > I understand the logic but would it be possible to queue these incoming requests and wait until the selected backend is really available? > > > > > > backend a_tile? ? ? ? ? ? ? ? ? { > > >? ?.host? ? ? ? ? ? ? ? ? ? ? ? ?= "a.tile.openstreetmap.org"; > > >? ?.port? ? ? ? ? ? ? ? ? ? ? ? ?= "80"; > > >? ?.max_connections? ? ? ? ? ? ? = 2; > > > } > > > > > > If Varnish have, let's say 100 incoming requests in 1 second, how can I handle this "spike" without overloading the backend? > > > > > > All my google searches were "dead ends" so I think the question is poorly formulated. > > > > > > Note 1 : using [random|round_robin] directors could be a temporary solution > > > Note 2 : libvmod-dynamic is great but does not limit backend simultaneous connexions > > > > > > Many thanks for your help! > > > > > > ---------------------------------------------------------------------- > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- tranxene50 tranxene50 at openvz-diff-backups.fr From info at massivescale.net Mon Jun 29 09:46:14 2020 From: info at massivescale.net (Andrzej Godziuk) Date: Mon, 29 Jun 2020 11:46:14 +0200 Subject: Caching OSM tiles - how to not overload backends? In-Reply-To: References: <62cc477d-e27f-1ed0-bd16-06d4c7dd907f@openvz-diff-backups.fr> Message-ID: <20200629114614.395fa45c@ThinkPad> Hi, You may want to look into OSM-supported tile proxy software. It's not Varnish-based but maybe one of the options would be good enough for your use: https://wiki.openstreetmap.org/wiki/Tile_proxy Regards, Andrzej