4 ms·
Just wanted to throw out there that although I'm a fan of FUSE, it's not the only option. I've had fun implementing a virtual filesystem via the 9p protocol not
by aargh_aargh 2y ago
Just wanted to throw out there that although I'm a fan of FUSE, it's not the only option. I've had fun implementing a virtual filesystem via the 9p protocol not too long ago.
IIRC, I used py9p and the python experience was much nicer than fuse-python. You can mount a 9p service via FUSE (9pfuse) if you want. I just used the kernel v9fs client. If you're just looking to pass a filesystem through the network, I think I used the diod 9p server.
Overall, it's a nice little ecosystem to explore.
- hathawsh 2y agoIt looks like py9p was last released in 2013 and it's still marked as "beta". Cool project though!
- networked 2y agohttps://github.com/pbchekin/p9fs-py https://github.com/pbchekin/p9fs-py contains an active fork of py9p. When I played with 9P, this version of py9p was what worked to share a directory so a NetBSD client could mount it. It worked natively with https://man.netbsd.org/mount_9p.8 https://man.netbsd.org/mount_9p.8 without an external client. The important difference from diod was that py9p could speak 9P2000.u, which NetBSD understood, while diod only spoke 9P2000.L.
- packetlost 2y ago9p is such a great little protocol. diod[0] has a good amount of documentation on the protocol itself, but it's pretty simple. I have some notes here [1], but it's mostly just linking to primary sources. FUSE is great, but 9P is more general and has high quality implementations all over the place, even in Windows! One thing I'm not so sure about is the performance properties of 9p. I've seen some places indicate it's rather slow, but nothing definitive. Does anyone have any benchmarks or info on that? [0]: https://github.com/chaos/diod/blob/master/protocol.md https://github.com/chaos/diod/blob/master/protocol.md [1]: https://athenaeum.wiki/Zettelkasten/9p https://athenaeum.wiki/Zettelkasten/9p
- mananaysiempre 2y ago> 9P [...] has high quality implementation[...] in Windows Do you know if it’s possible to mount one’s own 9P servers under Windows? I seem to remember a comment from a Microsoft employee on GitHub something-or-other that said that capability is private to WSL2, but I can’t find it right now.
- packetlost 2y agoI'm not sure if you can mount a 9P filesystem from windows normally, I'll try. I'm not seeing any resources online about it either.
- magicalhippo 2y agoI looked at 9p as a NFS/SMB replacement some time ago for a project, and benchmarks seems scarce. I did find this[1] set of benchmarks but it's from 2005. I also found this[2] from 2016 which points out some performance barriers, and it doesn't sound like an easy fix without some new extensions. However there's also this[3] post from 2022 about some patches suggesting a 10x improvement in Linux 9p performance. Would be interesting to see how things are these days. [1]: https://www.usenix.org/legacy/events/usenix05/tech/freenix/full_papers/hensbergen/hensbergen_html/index.html https://www.usenix.org/legacy/events/usenix05/tech/freenix/f... [2]: https://github.com/Harvey-OS/harvey/issues/18 https://github.com/Harvey-OS/harvey/issues/18 [3]: https://www.phoronix.com/news/Linux-9p-10x-Performance https://www.phoronix.com/news/Linux-9p-10x-Performance
- me-vs-cat 2y agoDid you end up using 9p as a NFS/SMB replacement? If yes, do you still use it today or why did you stop?
- magicalhippo 2y agoI ended up not pursuing it, but I feel like it would be interesting to give it a whirl just to compare, given hardware and code has evolved as mentioned.
- Twirrim 2y agoI was experimenting about 18 months ago with FUSE in front of an HTTPS URL, essentially a large file I wanted to be able to random read as if it was local, without downloading it first. One of the things I ran in to that made it painful, was that the block sizes for FUSE were really small, it made for a lot of latency and churn of HTTP calls to the back end that ended up needing some fairly complicated caching/pre-reading logic to handle. Kernel read-ahead logic never seemed to kick in (and I didn't do any investigation in to that at the time, other than not finding any particular way to induce it)
- yencabulator 2y ago1) FUSE block sizes are somewhat adjustable (kernel forces min/max) 2) You can rechunk it in your HTTP client to make fatter HTTP requests: https://go.dev/talks/2013/oscon-dl.slide#51 https://go.dev/talks/2013/oscon-dl.slide#51 -- there is even a way in FUSE of pushing the fatter results into the kernel page cache to minimize overhead of coming reads: https://pkg.go.dev/bazil.org/fuse#Conn.NotifyStore https://pkg.go.dev/bazil.org/fuse#Conn.NotifyStore
- VMtest 2y agoto note here is that fuse(virtiofs) can be used for better performance in qemu than 9p(virtio-9p) can read the faq in https://virtio-fs.gitlab.io https://virtio-fs.gitlab.io