3 ms·
> The performance and reliability of the ZFS driver leaves lots to be desired. No wonder: it calls the zfs(1) tool and parses its output to do its work. Again.
by pgeorgi 3y ago
> The performance and reliability of the ZFS driver leaves lots to be desired.
No wonder: it calls the zfs(1) tool and parses its output to do its work. Again. and again. and again.
- LanternLight83 3y agoI once wrote a line of shell piping zfs into awk while walking the tree of datasets, but it was so slow i decided i didn't need to after all. I wonder what a filesystem would look like that made the performance of meta-reflection a primary concern.
- justinclift 3y agoShouldn't it be directly calling the "zed" ZFS daemon to get that info instead?
- pgeorgi 3y agoPerhaps. Thing is, https://github.com/moby/moby/blob/670bc0a46c4ca03b75f1e72f73b8302bce90275a/daemon/graphdriver/zfs/zfs.go https://github.com/moby/moby/blob/670bc0a46c4ca03b75f1e72f73... is using https://github.com/mistifyio/go-zfs https://github.com/mistifyio/go-zfs which features code like `out, err := zfsOutput("get", "-H", key, d.Name)` (Source: https://github.com/mistifyio/go-zfs/blob/master/zfs.go#L315 https://github.com/mistifyio/go-zfs/blob/master/zfs.go#L315) to get a single zfs property. Somebody chose to use a library as abstraction that looks good but is implemented as a MVP (nothing wrong with that). "In the future, we hope to work directly with libzfs" should have raised an alarm somewhere, though.
- justinclift 3y agoInteresting. I'd been meaning to check if there are go libraries for working with ZFS. Looks like the answer to that is "yes, but be careful as some are kind of dodgy". :/ --- Oh, that library bills itself as "Simple wrappers for ZFS command line tools", rather than as a ZFS interface. Wonder why the Moby project picked that one then? Maybe a case of "it was the best choice at the time".
- pgeorgi 3y agoThere's https://github.com/openzfs/zfs/tree/master/contrib/pyzfs https://github.com/openzfs/zfs/tree/master/contrib/pyzfs, which is as official as it gets.
- justinclift 3y agoSounds like that would be the better choice. :)