Open
Description
The MemoryBlobStore limits the delegate store to a single thread, which can degrade performance. It effectively forces all 'put', 'get' and other operations to be bound to a single queue.
I've written a sample test and a one-liner change to highlight the problem. This is here: brettniven@b7f08e2. By increasing the executor threads, it obviously has much better performance.
I can assist on a fix - I'm just not sure on the best approach as I can't figure out why it would have the '1 thread' limit in the first place. Some links to explain what is happening:
- MemoryBlobStore constructs executorService with a pool limit of 1:
- All put/get/other operations invoke executeBlobStoreTask, which waits, here:
- The executorService is documented in comments here:
... but I can't work out a reason for it needing to be limited to 1 thread. Each delegate store should have it's own locking code, where applicable.
For reference, our setup is:
- GWC embedded in GeoServer, 1.24.x, using Kartoza docker image
- We're hosting in Azure, using an Azure File Share (which unfortunately for us, is 'slow' for a few potential reasons, which exacerbates this issue - we're in the process of trialling the Azure Blob Store plugin)
- We're using a MemoryBlobStore as a 2-layer cache, fronting a FileBlobStore. i.e. innerCachingEnabled=true.
- We investigated performance and found that we get substantially better performance when we turn the MemoryBlobStore off, which is a very simple workaround for this issue. However... we believe we've also found a thread deadlock issue in the FileBlobStore code (which I'll raise in another issue when time permits)
Metadata
Assignees
Labels
No labels
Activity