Hacker News new | ask | show | jobs
by jbott 1036 days ago
I don’t think the point about disk wear is true. ZFS is a block-based CoW filesystem already, so the “erase” is actually something more like “make a new metadata entry that points to an earlier state snapshot”. Plus, I’d expect normal disk usage (ie. chrome disk cache) probably far outweighs any disk wear you’d get from the (relatively) small size of files you get written into /.

Unless you’re working on a server with a ton of ram, I also think using tmpfs is more likely to shoot yourself in the foot with excess memory pressure. I don’t know of a way for the kernel to free memory if you write a huge file to the tmpfs partition by mistake, unless you use swap, and then you have the problems that come with that.

Tmpfs might be faster though!

2 comments

> tmpfs is more likely to shoot yourself in the foot with excess memory pressure

It defaults to 50% of physical RAM, but you can set the size option to whatever you want: https://www.kernel.org/doc/html/latest/filesystems/tmpfs.htm...

(So yes, something to consider, but totally possible to mitigate)

TIL!
You do need enough RAM for this, though RAM is relatively cheap these days.