I have output of zdb -DDD geek1
command:
[root@zfs-test centos]# zdb -DDD geek1
DDT-sha256-zap-duplicate: 8193 entries, size 290 on disk, 141 in core
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
2 8K 1G 1G 1023M 24K 3G 3G 3.00G
16K 1 128K 128K 128K 16K 2G 2G 2.00G
DDT histogram (aggregated over all DDTs):
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
2 8K 1G 1G 1023M 24K 3G 3G 3.00G
16K 1 128K 128K 128K 16K 2G 2G 2.00G
Total 8.00K 1.00G 1.00G 1023M 40K 5G 5G 5.00G
dedup = 5.00, compress = 1.00, copies = 1.00, dedup * compress / copies
= 5.00
I read about ZFS on internet and also here.
I created 2 files. First is random file from /dev/urandom and second one from /dev/zero. Each file have 1GB. I copied 3x urandom file and 2x zero file to my ZFS server. Minimum block size of ZFS is 128k.
I have following questions:
- What does
refcnt
means? - What does
DSIZE
mean in allocated column and how can I count it? - There was 8193 entries (unique blocks). What does numbers 290 and 141 means? According this article, I should be able to count how much data table takes in my RAM (8193x141B=1,1MB). If it is ok, what does 8193x290B=2,26MB means? Is that table also saved on disk?
- What
compres
andcopies
in last line means?
Please, include some example if it is possible.
Best Answer
1:
refcnt
means reference count, i.e. the number of times blocks are referenced by objects (It is a power of two progression so1
is1
but2
actually means2
or3
1;4
means4
,5
,6
, or7
and so on)2:
DSIZE
= On disk size,LSIZE
= logical (in memory),PSIZE
= physical. On disk and physical sizes are equal or very close together unless you set zfs to have more than one copy of data blocks in which case on disk size will be larger.3: 290 bytes is the size a deduplication table entry uses on disk and 141 bytes is the amount of RAM an entry uses. The
DDT
is stored and synced on disk and indeed currently uses 2.26MB in your case.4:
Compress
means the zpool compression ratio (it is unrelated to deduplication). As compression is likely not enabled, the ratio is 1., i.e. no compression at all. Copies means the ratio of ditto blocks (kind of the opposite of deduplication) stored. There are no ditto blocks so the ratio is 1. too.Example of output with compression and ditto blocks enabled:
1 In your case, the count is clearly exactly equal to
3
(3 GB referenced stored in 1 GB of disk).