Re: Infernalis, cephfs: difference between df and du

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 20, 2016 at 6:40 PM, Francois Lafont <flafdivers@xxxxxxx> wrote:
> Hi,
>
> On 19/01/2016 07:24, Adam Tygart wrote:
>> It appears that with --apparent-size, du adds the "size" of the
>> directories to the total as well. On most filesystems this is the
>> block size, or the amount of metadata space the directory is using. On
>> CephFS, this size is fabricated to be the size sum of all sub-files.
>> i.e. a cheap/free 'du -sh $folder'
>
> Ah ok, interesting. I have tested and I have noticed however that size
> of a directory is not updated immediately. For instance, if I change
> the size of the regular file in a directory (of cephfs) the size of the
> size doesn't change immediately after.

It's updated lazily so it's not instantaneous, but it should be pretty
fast. Probably within 30 seconds, and usually a lot less.
-Greg

>
>> $ stat /homes/mozes/tmp/sbatten
>>   File: '/homes/mozes/tmp/sbatten'
>>   Size: 138286          Blocks: 0          IO Block: 65536  directory
>> Device: 0h/0d   Inode: 1099523094368  Links: 1
>> Access: (0755/drwxr-xr-x)  Uid: (163587/   mozes)   Gid: (163587/mozes_users)
>> Access: 2016-01-19 00:12:23.331201000 -0600
>> Modify: 2015-10-14 13:38:01.098843320 -0500
>> Change: 2015-10-14 13:38:01.098843320 -0500
>>  Birth: -
>> $ stat /tmp/sbatten/
>>   File: '/tmp/sbatten/'
>>   Size: 4096            Blocks: 8          IO Block: 4096   directory
>> Device: 803h/2051d      Inode: 9568257     Links: 2
>> Access: (0755/drwxr-xr-x)  Uid: (163587/   mozes)   Gid: (163587/mozes_users)
>> Access: 2016-01-19 00:12:23.331201000 -0600
>> Modify: 2015-10-14 13:38:01.098843320 -0500
>> Change: 2016-01-19 00:17:29.658902081 -0600
>>  Birth: -
>>
>> $ du -s --apparent-size -B1 /homes/mozes/tmp/sbatten
>> 276572  /homes/mozes/tmp/sbatten
>> $ du -s -B1 /homes/mozes/tmp/sbatten
>> 147456  /homes/mozes/tmp/sbatten
>>
>> $ du -s -B1 /tmp/sbatten
>> 225280  /tmp/sbatten
>> $ du -s --apparent-size -B1 /tmp/sbatten
>> 142382  /tmp/sbatten
>>
>> Notice how the apparent-size version is *exactly* the Size from the
>> stat + the size from the "proper" du?
>
> Err... exactly? Are you sure?
>
> 138286 + 147456 = 285742 which is != 276572, no?
> Anyway thx for your help Adam.
>
>
> --
> François Lafont
> _______________________________________________
> ceph-users mailing list
> ceph-users@xxxxxxxxxxxxxx
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux