Dima Kogan wrote... > To speed up package installs in schroots (both with sbuild and without) > I usually add /var/cache/apt/archives to the set of bind-mounts in the > fstab of most profiles. This creates a global package cache, which saves > lots of time and bandwidth. > > Is there a strong reason to not do this by default? If not for sbuild, > then maybe we can do this for the other profiles. Or if not even that, > we can add a commented-out line to the fstab files to make it easy for > users to turn that on.
While not completely against it, I'm somewhat reluctant to promote this trick that I'd rather call a dirty hack. The issues I see with this poor man's caching boil down to these two points: First, this cache never expires hence will fill up disk without limits. And second, any job in the schroot session that does "apt clean" will happily wipe the cache for everybody, even for other processes in other sessions that want to use it that very moment, leading to very strange errors - there must be a reason why you cannot "apt clean" while an "apt update" is running. To overcome these, I could think of another service that watches that cache directory (inotify-based perhaps), makes files immutable once completely downloaded (so "apt clean" has no effect), and possibly expires older files using some scheme - but only if no session is currently running. At that point I'd rather suggest to refer to some existing caching proxy implementation, to name a few without making a particular recommendation: squid with some extra config snippets, approx, apt-cacher-ng. And modify the chroot's apt configuration to use that one. That will not see the same performance, but it's robust and well- established. All the best, Christoph
signature.asc
Description: PGP signature