
데이터 세트에서 이 쿼리를 실행할 때
zfs list -d 1 -t all -o name,used,refer,written,compressratio sfg-backup/mx
다음 통계가 표시됩니다.
zfs list -d 1 -t all -o name,used,refer,written,compressratio sfg-backup/mx
NAME USED REFER WRITTEN RATIO
sfg-backup/mx 300G 276G 0 1.80x
sfg-backup/mx@madcow_2023-04-15_23:15:00_UTC 4.04G 275G 275G 1.28x
...
sfg-backup/mx@madcow_2023-04-21_01:15:00_UTC 0B 276G 0 1.28x
sfg-backup/mx@madcow_2023-04-21_02:15:00_UTC 0B 276G 4.26G 1.28x
sfg-backup/mx@madcow_2023-04-21_03:15:00_UTC 0B 276G 0 1.28x
그런데 백업을 실행해보니 madcow_2023-04-21_01:15:00_UTC
백업 용량이 4.26GB가 아닌 31.4GB 로 마지막 스냅샷이 남아있습니다.
syncoid --no-sync-snap 10.0.1.2:sfg-backup/mx work/sfg/mx
NEWEST SNAPSHOT: madcow_2023-04-21_03:15:00_UTC
Sending incremental sfg-backup/mx@madcow_2023-04-21_01:15:00_UTC ... madcow_2023-04-21_03:15:00_UTC (~ 31.4 GB):
31.5GiB 0:03:16 [ 163MiB/s] [==================================================================================================>] 100%
압축을 추가하면 -c
크기가 4.3G로 늘어납니다(이 스냅샷은 약간 다르지만 콘텐츠는 거의 동일하지 않습니다.
zfs send -nv -c -I sfg-backup/mx@madcow\_2023-04-24\_00:15:00\_UTC sfg-backup/mx@madcow\_2023-04-24\_03:15:00\_UTC
send from @madcow_2023-04-24_00:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_01:15:00_UTC estimated size is 215M
send from @madcow_2023-04-24_01:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_02:15:00_UTC estimated size is 4.09G
send from @madcow_2023-04-24_02:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_03:15:00_UTC estimated size is 624B
total estimated size is 4.30G
# without -c flag:
zfs send -nv -I sfg-backup/mx@madcow\_2023-04-24\_00:15:00\_UTC sfg-backup/mx@madcow\_2023-04-24\_03:15:00\_UTC
send from @madcow_2023-04-24_00:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_01:15:00_UTC estimated size is 216M
send from @madcow_2023-04-24_01:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_02:15:00_UTC estimated size is 31.3G
send from @madcow_2023-04-24_02:15:00_UTC to sfg-backup/mx@madcow_2023-04-24_03:15:00_UTC estimated size is 624B
total estimated size is 31.5G
이렇게 큰 크기 차이가 발생하는 원인이 무엇인지 이해하도록 도와주실 수 있나요? ZFS 압축에서 보고된 값이 1.28이고 전송 압축이 31.5/4.3=7.3인 이유는 무엇입니까?
답변1
WRITTEN
쇼압축실제로 데이터세트/스냅샷에 기록된 데이터입니다. 전체 파일을 역참조하지 않고 이전 비압축 데이터 위에 고도로 압축 가능한 데이터를 작성 했습니다 sfg-backup/mx@madcow_2023-04-21_01:15:00_UTC
.madcow_2023-04-21_03:15:00_UTC
무작위로 덮어쓸 수 있는 큰 파일(예: 가상 디스크 이미지 파일, 데이터베이스 등)이 있고 32G의 원시 데이터를 작성하여 4G의 압축 데이터가 되었다고 가정합니다.
zfs send -c
압축된 4G 델타만 전송하여 압축된 레코드를 그대로 보냅니다. 반면 zfs send
(없음 -c
)은 디스크에 있는 데이터의 압축을 풀어 전체 32G 크기로 확장합니다.