[ccache] Multiple directories for CCACHE_DIR?
anders at itension.se
Tue May 17 19:51:00 UTC 2016
Joel Rosdahl wrote:
>> If not, would be a good idea to implement that?
> I think that it could be interesting to investigate, but there are lots of
> things to think about before implementing it. For instance:
> What should happen on a cache miss? Should ccache store the result in all
> directories? That could potentially be quite slow. Or should it only store
> the result in the first directory? If so, when and how do the other
> directories get populated?
The way it happens with memcached, is that the writing is offloaded to a
background daemon. So it is handled locally, and "transparently" remote.
There was also an option to not store anything in the cache, only read ?
This is useful when you have for instance a CI build server populating.
> How should configuration file settings work? Should configuration be read
> only from one cache directory or from all?
The way that I looked at it, there was only configuration in the local.
Basically we still have most configuration in environment variables...
> Cache size configuration probably would need to be configured per cache
> directory. Does this imply that CCACHE_MAXSIZE variable no longer should
> override configuration file settings?
There was *no* cleaning of the remote. We had some "incidents", when
all clients started to inventory and clean the shared cache - at once!
The server would do it's own cleaning (using something like cron ?),
or just drop old records - this is what memcached does for instance.
> Which statistics counters would make sense to have in all cache directories
> (cache hit/miss, etc.) and which would not make sense (called for link,
> compile failed, etc.)?
Currently memcached keep its own statistics. Simplistic NFS/HTTP stores
would probably have to implement something similar, for hit and miss ?
I'm not sure that the "external" store (as I called them) would need
to use the same list of statistics as the regular "internal" store.
More information about the ccache