linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for compressed inline extents
@ 2021-08-21 23:25 Forza
  2021-08-22  5:45 ` Zygo Blaxell
  0 siblings, 1 reply; 9+ messages in thread
From: Forza @ 2021-08-21 23:25 UTC (permalink / raw)
  To: Btrfs BTRFS

I'd like to see the option to allow compressed extents to be inlined. It could greatly reduce disk usage and speed up small files by avoiding extra seeks.

I tried to understand why we don't allow it but could only find this reference  https://btrfs.wiki.kernel.org/index.php/On-disk_Format#EXTENT_DATA_.286c.29

"the extent is inline, the remaining item bytes are the data bytes (n bytes in case no compression/encryption/other encoding is used)." 

Is the limitation in the disk format or perhaps in the compression heuristics?

Not all use cases would benefit, and we'd have more metadata, which increase the risk of enospc. But i think it could be very valuable nonetheless. For example mail servers, source code/CI, webservers, and others that commonly deal with many small but highly compressible files. 


I did a quick test by copying all files smaller than 8192 bytes from my home server. The filesystem has 90GiB used. 

The result was 357129 files, 207605 inline. 792MiB disk usage, 1.0GiB data size, or 1.1% of fs usage. 

Zstd compressed them, which gave 295419 files inline. Total data size 500MiB. The size of the inlined files is 208MiB. 

Uncompressed the inlined files to see how much of the original data could have been compressed and inlined. 599MiB total data with 501MiB disk usage and 207576 inlined files. 

All in all we would save 501-208=293MiB, which is very good. Ontop of this we'd have savings because we avoid padding up to 4kiB block size due to inlining. Also my test only included files less than 8kiB. It is possible that many files larger than this could be compressed to less than max_inline size. 


Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-29 12:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21 23:25 Support for compressed inline extents Forza
2021-08-22  5:45 ` Zygo Blaxell
2021-08-22  7:09   ` Forza
2021-08-22  8:33     ` Zygo Blaxell
2021-08-23 19:34       ` Forza
2021-08-23 20:23         ` Zygo Blaxell
2021-08-27 10:08           ` David Sterba
2021-08-29 11:22             ` Forza
2021-08-29 12:07               ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).