GeoWebCache / geowebcache

GeoWebCache is a tile caching server implemented in Java that provides various tile caching services like WMS-C, TMS, WMTS, Google Maps, MS Bing and more
https://www.geowebcache.org
335 stars 280 forks source link

MemoryBlobStore limits the delegate store to a single thread #1275

Open brettniven opened 1 month ago

brettniven commented 1 month ago

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: https://github.com/brettniven/geowebcache/commit/b7f08e2567fb10a7bdd81fca32953fe503c9d876. 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:

... 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:

aaime commented 1 month ago

@brettniven I don't know either (some research would be needed) but:

Generally speaking, AFAIK a BlobStore implementation should be thread-safe, and a wrapper should not need to care for synchronizing/serializing access to it. @smithkm can you provide any more information/insight?