bluerider / liveroot

Initcpio hooks for overlayfs ontop of root
BSD 3-Clause "New" or "Revised" License
79 stars 13 forks source link

Format zram as btrfs? #15

Open steelcowboy opened 8 years ago

steelcowboy commented 8 years ago

So I use btrfs and love the space savings. I want to run my desktop system live and noticed from testing that btrfs allows for immense savings in zram (I have 10 100MB files full of zeros in a 512MB zram partition, uses 40MB).

Would it be possible to have an oroot=live option but also have the ability to set the zram device to be formatted as btrfs instead of ext2? My main question, however, is would there be any issues to doing this?

Btw my mount command for the zram was: mount -o noatime,autodefrag,compress=lzo,space_cache /dev/zram0 /mnt

steelcowboy commented 8 years ago

http://devjimheald.com/ramresults.txt

Here are some benchmarks with this vs my SSD. I didn't care about ext4 because I was mainly interested in compression. I used random data for my files and zram still destroys my SSD! Really looking forward to keeping my root in a compressed btrfs partition in the RAM!

bluerider commented 8 years ago

That is rather peculiar. Are you using lzo compression for your btrfs formatted zram block device? It is especially strange since you're using random data which shouldn't even be compressible.

steelcowboy commented 8 years ago

Sorry for the confusion! The benchmarks were done on random data, my first post was regarding files of only zeros.

To be clear, what I'm saying is: with btrfs and compression you not only will save space (and therefore RAM) but -- even with compression -- you'll still get much better performance than having the root on the SSD.

bluerider commented 8 years ago

For the former: My comment was regarding the random data. It's peculiar that you had better performance with btrfs formatted zram block devices considering that zram is already lzo compressed. BTRFS compression is basically lzo on lzo on normally incompressible data.

For the latter: It's expected that liveroot will have better performance due to writes occuring on ram. I'm a bit puzzled on the btrfs + compression statement as indicated in the previous point. Can you try using lz4 compression and seeing if there's any difference?