Deduplication (dedup) VS CompressionOS: Fedora18_x86_64
ZFS ÆÄÀϽýºÅÛ¿¡ compress°ú dedup ºñ±³
- zpool ¼³Á¤
# zpool create compress_test sdb
# zpool create dedup_test sdc
1. µð½ºÅ© È¿À²¼º ±â´É ºñ±³
- ¿É¼ÇÀû¿ë
# zfs set compression=on compress_test
# zfs get dedup,compression compress_test
NAME PROPERTY VALUE SOURCE
compress_test dedup off default
compress_test compression on local
# zfs set dedup=on dedup_test
# zfs get dedup,compression dedup_test
NAME PROPERTY VALUE SOURCE
dedup_test dedup on local
dedup_test compression off default
1) CentOS °¡ ¼³Ä¡µÇ¾îÀÖ´Â qcow2 À̹ÌÁö 1°³ ´Ù¿î·ÎµåÈÄ ºñ±³
À̹ÌÁö ¿ë·® : ¾à 11G
# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
compress_test 2.72T 5.47G 2.71T 0% 1.00x ONLINE -
dedup_test 2.72T 10.3G 2.71T 0% 1.01x ONLINE -
# zdb -S compress_test
Simulated DDT histogram:
bucket allocated(ÇÒ´çµ¥ÀÌŸ) referenced(ÂüÁ¶µ¥ÀÌŸ)
=>¹°¸®ÀûÀÎ µð½ºÅ©½ÎÀÌÁî => Pool¿¡¼ ÂüÁ¶µÇ´Â ³í¸®µð½ºÅ©
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 80.6K 10.1G 5.28G 5.40G 80.6K 10.1G 5.28G 5.40G
2 488 61M 26.6M 27.4M 977 122M 53.1M 54.8M
4 1 128K 4.50K 8K 4 512K 18K 32K
64 1 128K 4.50K 8K 123 15.4M 554K 984K
256 1 128K 4.50K 8K 264 33M 1.16M 2.06M
Total 81.1K 10.1G 5.30G 5.43G 81.9K 10.2G 5.33G 5.46G
dedup = 1.01, compress = 1.92, copies = 1.02, dedup * compress / copies = 1.89
(Áߺ¹Á¦°ÅÀ²)
# zdb -S dedup_test
Simulated DDT histogram:
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 80.6K 10.1G 10.1G 10.1G 80.6K 10.1G 10.1G 10.1G
2 488 61M 61M 61M 977 122M 122M 122M
4 1 128K 128K 128K 4 512K 512K 512K
64 1 128K 128K 128K 123 15.4M 15.4M 15.4M
256 1 128K 128K 128K 264 33M 33M 33M
Total 81.1K 10.1G 10.1G 10.1G 81.9K 10.2G 10.2G 10.2G
dedup = 1.01, compress = 1.00, copies = 1.00, dedup * compress / copies = 1.01
(Áߺ¹Á¦°ÅÀ²)
¡Ø ÆÄÀÏ¿¡ µû¶ó¼ Â÷ÀÌ´Â ÀÖ°ÚÁö¸¸ ÇöÀç OSÀ̹ÌÁö¸¸À» °¡Áö°í ºñ±³ÇßÀ»¶§´Â compress ¿É¼ÇÀû¿ëµÈ µð½ºÅ©¿¡ È°¿ëµµ ¹èÀÌ»ó ³ô´Ù. ¶ÇÇÑ ±âº» OS À̹ÌÁö¿¡´Â dedup(Áߺ¹Á¦°Å) µ¥ÀÌŸ°¡ °ÅÀÇ Á¸ÀçÇÏÁö ¾Ê´Âµí...
2) ±âº» OS qcow2 À̹ÌÁö 16°³ ´Ù¿î·ÎµåÈÄ ºñ±³ (¿î¿µÃ¼Á¦´Â Ubuntu ¹öÀüº° CentOS ¹öÀüº°·Î...)
# zpool list
# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
backup 2.72T 124G 2.60T 4% 1.00x ONLINE -
compress_test 2.72T 31.3G 2.69T 1% 1.00x ONLINE -
dedup_test 2.72T 33.2G 2.69T 1% 2.18x ONLINE -
# zdb -S compress_test
Simulated DDT histogram:
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 159K 19.9G 10.1G 10.4G 159K 19.9G 10.1G 10.4G
2 78.4K 9.80G 5.17G 5.29G 215K 26.9G 14.2G 14.5G
4 23.6K 2.96G 1.51G 1.54G 96.5K 12.1G 6.13G 6.29G
8 117 14.6M 4.65M 4.86M 1.11K 142M 38.7M 40.7M
16 2 256K 9K 16K 44 5.50M 198K 352K
64 1 128K 4.50K 8K 70 8.75M 315K 560K
128 1 128K 4.50K 8K 253 31.6M 1.11M 1.98M
256 3 384K 13.5K 24K 1.13K 145M 5.08M 9.04M
1K 2 256K 9K 16K 2.86K 367M 12.9M 22.9M
2K 1 128K 4.50K 8K 2.40K 307M 10.8M 19.2M
Total 261K 32.7G 16.8G 17.2G 479K 59.8G 30.5G 31.3G
dedup = 1.82, compress = 1.96, copies = 1.02, dedup * compress / copies = 3.48
==> 59.8 / 32.7 = ¾à 1.82
¾ÐÃàÀÌ Àû¿ëµÈ »óÅ¿¡¼ dedup ¿É¼ÇÀ» »ç¿ëÇϰԵȴٸé Áߺ¹Á¦°ÅÀ² 1.82 , compress(¾ÐÃàÀ²) 1.96
ÅäÅ» 3.48 Á¤µµÀÇ µð½ºÅ© È¿À²¼º
# du -sh *
636M 1.qcow2
5.5G 2.qcow2
5.5G 3.qcow2
5.5G 4.qcow2
6.6G 5.qcow2
902M 6.qcow2
736M 7.qcow2
698M 8.qcow2
823M 9.qcow2
761M 10.qcow2
818M 11.qcow2
775M 12.qcow2
805M 13.qcow2
670M 14.qcow2
987M 15.qcow2
==> ½ÇÁ¦ ÆÄÀϽÎÀÌÁîµµ ½ÇÁ¦ ÆÄÀÏÅ©±âº¸´Ù ¾ÐÃà·ü/Áߺ¹Á¦°ÅÀ²¿¡ µû¶ó »ó´çÈ÷ °¨¼Ò
# zdb -S dedup_test
Simulated DDT histogram:
bucket allocated referenced
______ ______________________________ ______________________________
refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
------ ------ ----- ----- ----- ------ ----- ----- -----
1 159K 19.9G 19.9G 19.9G 159K 19.9G 19.9G 19.9G
2 78.4K 9.80G 9.80G 9.80G 215K 26.9G 26.9G 26.9G
4 23.6K 2.96G 2.96G 2.96G 96.5K 12.1G 12.1G 12.1G
8 117 14.6M 14.6M 14.6M 1.11K 142M 142M 142M
16 2 256K 256K 256K 44 5.50M 5.50M 5.50M
64 1 128K 128K 128K 70 8.75M 8.75M 8.75M
128 1 128K 128K 128K 253 31.6M 31.6M 31.6M
256 3 384K 384K 384K 1.13K 145M 145M 145M
1K 2 256K 256K 256K 2.86K 367M 367M 367M
2K 1 128K 128K 128K 2.40K 307M 307M 307M
64K 1 128K 128K 128K 92.5K 11.6G 11.6G 11.6G
Total 261K 32.7G 32.7G 32.7G 571K 71.4G 71.4G 71.4G
dedup = 2.19, compress = 1.00, copies = 1.00, dedup * compress / copies = 2.19
==> 71.4 / 32.7 = ¾à 2.19
¾ÐÃà¿É¼ÇÀ» È°¼ºÈ½ÃŲ ÆÄƼ¼Ç°ú µ¿ÀÏÇÑ µ¥ÀÌŸÁö¸¸ ¾ÐÃàÀÌ µÇ¾îÀÖÁö ¾Ê¾Ò±â¿¡ Áߺ¹Á¦°ÅÀ²ÀÌ ³ô¾ÆÁüÀ» º¼¼öÀÖ´Ù.
# du -sh *
1.3G 1.qcow2
11G 2.qcow2
11G 3.qcow2
11G 4.qcow2
13G 5.qcow2
1.7G 6.qcow2
2.9G 7.qcow2
2.8G 8.qcow2
3.1G 9.qcow2
3.0G 10.qcow2
3.1G 11.qcow2
3.0G 12.qcow2
3.2G 13.qcow2
2.9G 14.qcow2
2.1G 15.qcow2
°á·Ð) ´ëºÎºÐÀÇ ÄÉÀ̽º¿¡¼´Â compression(¾ÐÃà)ÀÌ µð½ºÅ© ¿ë·®À» È¿À²ÀûÀ¸·Î »ç¿ëÇϱ⿡ À¯¸®Çϸç dedup(Áߺ¹Á¦°Å) Àº ¹é¾÷, ¼Ò½º¹öÀü°ü¸®¿Í °°Àº Áߺ¹µÇ´Â µ¥ÀÌŸ°¡ ¸¹À»°æ¿ì¿¡ »ç¿ëÇÏ´Â°Ô È¿À²ÀûÀÌ´Ù.
2. µð½ºÅ© I/O ¼º´Éºñ±³
# compressing
Àбâ(Read)
dd if=Ubuntu_12.04_64_100G.qcow2 of=aa.img bs=1024k count=10000
3.90671 s, 837 MB/s
3.84815 s, 849 MB/s
3.84842 s, 849 MB/s
¾²±â(Write)
dd of=Ubuntu_12.04_64_100G.qcow2 if=aa.img bs=1024k count=10000
3.85243 s, 848 MB/s
3.85717 s, 847 MB/s
3.8246 s, 855 MB/s
# dedup
Àбâ(Read)
dd if=Ubuntu_12.04_64_100G.qcow2 of=aa.img bs=1024k count=10000
30.3455 s, 108 MB/s
18.505 s, 177 MB/s
17.3722 s, 188 MB/s
¾²±â(Write)
dd of=Ubuntu_12.04_64_100G.qcow2 if=aa.img bs=1024k count=10000
17.6155 s, 186 MB/s
17.7228 s, 184 MB/s
17.8607 s, 183 MB/s