Re: Caching OSM tiles - how to not overload backends?
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@varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > ___ varnish-misc mailing list varnish-misc@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: Caching OSM tiles - how to not overload backends?
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@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: varnish node without gcc
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@varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > ___ varnish-misc mailing list varnish-misc@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: varnish node without gcc
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@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
varnish node without gcc
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 ___ varnish-misc mailing list varnish-misc@varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc