Style update triggering truncate is inefficient

Hi, I’m using gwc-s3 extension and when the styles are updated, truncate is triggered. The problem is, that it seems like the server traverses the entire bbox on all zoom levels, which means that it triggers 10s of millions of requests on S3 (with pretty much all being 404), when it should be just one, as style should be part of the cache key if it isn’t already.

The only way to circumvent this right now is to restart the server when you have saved the style afaik, which is less than ideal.

Not sure I understand?

If you change the style you change the appearance of the map; so all tiles
should be truncated (since they will all need to be recreated to reflect
the new appearance)?

Hi Jody,
he’s right, it’s a well-known problem (at least, to me) waiting for funds
to show up in order to get solved.
You might have a completely empty cache, and the current code still blindly
goes to all possible tiles and tries to delete them, because it has no idea
if they are there or not.
That generic code would be needed for specific case, but for a style
change, we can implement faster alternatives that do look for, and delete,
only tiles that are actually there.

As said, matter of someone showing up with funds for core developers, or
someone that can do the change on their own and contributes it back.

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit GeoSolutions Enterprise Support Services for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail

On Fri, Aug 23, 2024 at 6:31 PM Jody Garnett via OSGeo Discourse <
noreply@discourse.osgeo.org> wrote:

jive https://discourse.osgeo.org/u/jive Leader
August 23

Not sure I understand?

If you change the style you change the appearance of the map; so all tiles
should be truncated (since they will all need to be recreated to reflect
the new appearance)?


Visit Topic
https://discourse.osgeo.org/t/style-update-triggering-truncate-is-inefficient/49823/2
or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here
https://discourse.osgeo.org/email/unsubscribe/a619b0bd8798fcbc7efaba61394298502c9e795a9b720cd8e1fb789732e4d10c
.

Would having something like DiskQuota that keeps track of tiles in play
help?

Nope. The specific truncate code is just enumerating all possible tiles in
the pyramid and try to delete all of them, one by one. It’s just pretty
inefficient. Reducing the pyramid size would help, every zoom level less
more than halves the total number of possible tiles.

The integration in Geoserver makes it seem harmless, until you see how its
implemented internally. Usual problem with layered code, “implementation
details” do matter a lot when dealing with large numbers of items

Cheers
Andrea

Il ven 23 ago 2024, 19:56 Jody Garnett via OSGeo Discourse <
noreply@discourse.osgeo.org> ha scritto:

jive https://discourse.osgeo.org/u/jive Leader
August 23

Would having something like DiskQuota that keeps track of tiles in play
help?


Visit Topic
https://discourse.osgeo.org/t/style-update-triggering-truncate-is-inefficient/49823/4
or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here
https://discourse.osgeo.org/email/unsubscribe/1bbb96662ef80f0c5b971533d37a11c16e20309262e73be81d0cd60f779b53c2
.

GWC has option to empty the cache for a layer. I think it should also implement the option to empty the cache for the layer + style combination.

A minor optimization now would be that it could empty the cache for a layer on style update, if there is only one style tied to the layer.

I can make a pull request that optimizes this on GWC and geoserver, if it doesn’t exist already, although it will take time, because I’m totally unfamiliar with the codebase… Would the project accept a pull request, that optimizes this?

We are very much open to contributions
https://github.com/geoserver/geoserver/blob/main/CONTRIBUTING.md (see
link for details on contributing via open source geospatial foundation, and
tests and so on).

I find it is very difficult for me personally to work on Amazon / Azure etc
as I do not have a test environment. We very much depend on people trying
out the software in their environment, and fixing problems found in their
environment.

Thanks!