-
Notifications
You must be signed in to change notification settings - Fork 879
NG: caching as a first class citizen #647
Comments
Thanks! How do this compare to, say, redis? |
On Wed, Oct 22, 2014 at 01:55:25PM -0700, Olivier Gambier wrote:
It's content-addressable, so (from its README):
That means it's not going to work for anything we edit (e.g. tag files |
groupcache solves a narrower class of problems but by virtue of the extra constraints addresses several difficult caching problems (hot spots, thundering herd, etc) inherent in the more general purpose caches like memcache or redis. The two are not mutually exclusive. As @wking points out - groupcache, unmodified, will not be suitable for mutable state. |
On Wed, Oct 22, 2014 at 02:28:44PM -0700, Bo Shi wrote:
So the questions seems to be:
If we do have content-addressable non-image data or want to cache |
Good point - it also occurred to me that the benefit may be marginal. Anecdotally at least, a lot of images I've interacted with are composed of small numbers of large layers and many tiny layers. Would it be difficult to crawl the public index to generate a histogram of layers and their sizes?
Coming from a different angle (assuming V2 is still under design), is there data that isn't content-addressable that could be made content-addressable? |
On Wed, Oct 22, 2014 at 03:04:57PM -0700, Bo Shi wrote:
My (sadly dead 1) detached signatures (moby/moby#6070) would |
A couple notes: Content-adressibility is for layers only. There doesn't seem to be a benefit in content-adressibility for manifest files. "Caching" layers is not something we have been looking into - many people offload actual delivery to a CDN (we do), which does provide more benefits than caching big objects on the service would - and this pattern is likely to be kept for v2. Making it possible to use alternative cache engines for manifest files (memcache or otherwise) is something that we should consider - though (being lazy) I would likely support redis as being the default, officially maintained. Would be nice to have alternatives, sure (provided it's easy to mutate the objects). |
Bottom-line being: I would rather focus on making the content easy to be cached at the transport layer (http), rather than dedicating too much intelligence in application level caching. |
The next generation registry and the distribution project are making plans to ensure content addressability across layers and manifests. While there are no immediate plans to integrate groupcache, As the V2 registry currently stands, distribution can benefit directly from http caching. It follows that groupcache would only help in addition. This issue is going to be closed. A Proposal and PR is welcome for groupcache integration in docker/distribution. |
Caching seems to be an important feature and it might be nice to elevate it to work out of the box in a registry cluster. If content addressable storage is a goal (#616 (comment)), it seems https://github.com/golang/groupcache would be an ideal candidate as it's specifically designed for this class of distribution problem.
The text was updated successfully, but these errors were encountered: