Thread (26 messages) 26 messages, 10 authors, 2012-10-31

Re: Why btrfs inline small file by default?

From: ching <hidden>
Date: 2012-10-30 23:42:03

On 10/31/2012 06:16 AM, cwillu wrote:
On Tue, Oct 30, 2012 at 3:40 PM, ching [off-list ref] wrote:
quoted
On 10/30/2012 08:17 PM, cwillu wrote:
quoted
quoted
quoted
If there is a lot of small files, then the size of metadata will be
undesirable due to deduplication
Yes, that is a fact, but if that really matters depends on the use-case
(e.g., the small files to large files ratio, ...). But as btrfs is designed
explicitly as a general purpose file system, you usually want the good
performance instead of the better disk-usage (especially as disk space isn't
expensive anymore).
As I understand it, in basically all cases the total storage used by
inlining will be _smaller_, as the allocation doesn't need to be
aligned to the sector size.
if i have 10G small files in total, then it will consume 20G by default.

ching
No.  No they will not.  As I already explained.

root@repository:/mnt$ mount ~/inline /mnt -o loop
root@repository:/mnt$ mount ~/inline /mnt2 -o loop,max_inline=0

root@repository:/mnt$ mount
/dev/loop0 on /mnt type btrfs (rw)
/dev/loop1 on /mnt2 type btrfs (rw,max_inline=0)

root@repository:/mnt$ time for x in {1..243854}; do echo "some stuff"
quoted
/mnt/$x; done
real	1m5.447s
user	0m38.422s
sys	0m18.493s

root@repository:/mnt$ time for x in {1..243854}; do echo "some stuff"
quoted
/mnt2/$x; done
real    1m49.880s
user    0m40.379s
sys     0m26.210s

root@repository:/mnt$ df /mnt /mnt2
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/loop0            10485760    266952   8359680   4% /mnt
/dev/loop1            10485760   1311620   7384236  16% /mnt2

root@repository:/mnt$ btrfs fi df /mnt
Data: total=1.01GB, used=256.00KB
System, DUP: total=8.00MB, used=4.00KB
System: total=4.00MB, used=0.00
Metadata, DUP: total=1.00GB, used=130.22MB
Metadata: total=8.00MB, used=0.00

root@repository:/mnt$ btrfs fi df /mnt2
Data: total=2.01GB, used=953.05MB
System, DUP: total=8.00MB, used=4.00KB
System: total=4.00MB, used=0.00
Metadata, DUP: total=1.00GB, used=164.03MB
Metadata: total=8.00MB, used=0.00

root@repository:/mnt$ btrfs fi show
Label: none  uuid: e5440337-9f44-4b2d-9889-80ab0ab8f245
	Total devices 1 FS bytes used 130.47MB
	devid    1 size 10.00GB used 3.04GB path /dev/loop0

Label: none  uuid: cfcc4149-3102-465d-89b8-0a6bb6a4749a
	Total devices 1 FS bytes used 1.09GB
	devid    1 size 10.00GB used 4.04GB path /dev/loop1

Btrfs Btrfs v0.19

Any questions?
can the test be repeated for:
1. 3k per file with leaf size=4K
2. 60k per file with leaf size=64k


 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help