New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GEOS-9219] Fix gwc tile layer load performance regression at startup #3451
[GEOS-9219] Fix gwc tile layer load performance regression at startup #3451
Conversation
Yep, this one really got me mad but the original author cannot be relied to fix on his mess and the reviewer did not catch the problem..... Thank you for fixing it! |
32b3034
to
1af1e51
Compare
oh, cool then, glad to be back in the game :P |
DefaultTileLayerCatalog listens to Resouce events under the data directory's gwc-layers folder resource in order to notify its local instance listeners of tile layer configuration changes even when on a shared directory by several service instances. To do so, it was using both a "folder" listener on gwc-layers, and one listener per tile layer info resource (i.e. gwc-layers/*.xml). This resulted in a severe startup hit when there are several tile layers. This patch uses a single listener on the gwc-cache folder resource to handle all the scenarios, and hence removes the need to set up and cache one resource listener per tile layer.
1af1e51
to
dd54983
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I have been mostly working with jdbc configurations which is why I was not aware of causing this performance issue in a file-based setup. I have read through the code changes and all seems really clear. The functionality is preserved, as also proven by the passing unit test, but the issue is fixed. Thanks @groldan
ok, merging then, thanks for the review @NielsCharlier |
Indeed, I didn't need to add any extra test case cause it was well covered already so I based the refactoring on those |
@groldan are you going to backport this one? I believe 2.15.x is affected, not sure about 2.14.x |
@aaime sorry I couldn't come back to this before. Created a ticket for the backport: https://osgeo-org.atlassian.net/browse/GEOS-9219 |
DefaultTileLayerCatalog listens to Resouce events under
the data directory's gwc-layers folder resource in order to
notify its local instance listeners of tile layer configuration
changes even when on a shared directory by several service
instances.
To do so, it was using both a "folder" listener on gwc-layers,
and one listener per tile layer info resource (i.e. gwc-layers/*.xml).
This resulted in a severe startup hit when there are several
tile layers.
This patch uses a single listener on the gwc-cache folder resource
to handle all the scenarios, and hence removes the need to set up
and cache one resource listener per tile layer.