CoW variant: rpm2composefs #4223
Replies: 3 comments 6 replies
|
Um. That's is flying with so many technologies and whatnot that I've just barely even heard of that it's difficult to follow. And referring to CoW in rpm context, at this point only manages to raise my hackles. That's not a good place to start at 😅 Lets start from the basics. The use-case seems to be optimizing repeated similar/identical transactions, nevermind the implementation details. On systems that are used for image building. And so a cache as an optimization technique makes sense. Right? If so, that is something we can discuss. |
|
Yep, it's primarily about optimizing for disk I/O (speed) in the environments where you run many transactions with largely the same content, on the same (file)system. Image builds are the most prominent example. Here, RPMs could be thought of as basically just recipes for composing and merging filesystem trees (packages) from files stored in a single (ideally content-addressable) location on disk, rather than being the delivery medium itself. I can see two ways to approach this:
|
More efficient algorithms are always good, but it might be worth trying another approach first, which is to make rpm work faster and see if that is sufficient. This week I made rpm the second major test case for LumoSQL and it does indeed appear to make rpm work faster for me for the operations I tried. You compile up the LumoSQL library choosing LMDBv1.0 as the backend, change its soname with patchelf, and point LD_LIBRARY_PATH at the new libsqlite3. rpm doesn't know the difference (the file format is incompatible so you need to export/import to the new format to do performance testing.) LumoSQL also gives you encrypted rpm and checksummed rpm if you wish, but they won't help it go faster. I can share my recipe if you like, although it isn't polished. -- |
Uh oh!
There was an error while loading. Please reload this page.
I've been trying to think of ways to speed up image builds for the local package layering use case. The challenge is making big RPM transactions in image builds more incremental, so that the time cost of adding an additional package to a 2,391-package bootc system is closer to 1 than 2,391 + 1.
I think an important part of that is going to be caching uncompressed RPMs in a deduplicated way, similar to how rpm-ostree imports RPMs to OSTree commits.
I'm imagining a variant of RPM CoW where the transcode step is unpacking the RPM payload into a composefs store, and replacing the payload inside the RPM with an EROFS/composefs metadata image that references files in the composefs store. The install step would then reflink files from the composefs store to the installroot, rather than from the extents-transcoded RPMs.
The main advantage over extents-based RPM CoW is that all transcoded RPMs with the same backing store would be automatically duplicated at the file level. This is nice for keeping old versions of RPMs around in case you need to roll back. (yes, you could roll back the entire image, but it's also good to be able to roll back to a state you can efficiently edit/rebuild).
Garbage collection would be trickier than with extents-based CoW. Deleting an RPM would not free the space in the composefs store. So rpm2composefs would make more sense when managed by a DNF plugin or image building system that can be responsible for GC.
This would depend on additions to the plugin API: #2057.
All reactions