Is diskcache on a shared network volume officially supported?

64 Views Asked by At

We are running ImageResizer on multiple AWS Instances (currently 4) using an Elite license. At the moment each instance has its own local cache but that means each image request is generated and cached independently on every instance.

It also means when we deploy a new instance we either start with an empty cache and suffer poor performance on that instance while it populates, or copy the cache from an existing instance (this takes quite some time)

I was thinking of putting the cache on a shared network drive, access by all the instances.

Is this officially support, and would this cause any conflicts? Would all the servers attempt to run the cleanup operation if autoClean is enabled?

1

There are 1 best solutions below

0
Lilith River On

You would need to disable autoClean; cache eviction over the network is not an efficient process.

You would also see increased latency across the board and increased file lock contention.

It is a tradeoff that I don't normally suggest, but - measure for yourself. There are scenarios where it makes sense, but it's highly dependent on hit ratio, cache size, storage constraints, fileshare protocol, and whether you have any reverse proxy/cdn in play.