From nobody Fri Nov 11 20:51:06 2022 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N89pp3Zzsz4g1XW for ; Fri, 11 Nov 2022 20:51:14 +0000 (UTC) (envelope-from bfriesen@simple.dallas.tx.us) Received: from smtp.simplesystems.org (smtp.simplesystems.org [65.66.246.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4N89pp15s5z4TrV for ; Fri, 11 Nov 2022 20:51:14 +0000 (UTC) (envelope-from bfriesen@simple.dallas.tx.us) Authentication-Results: mx1.freebsd.org; none Received: from scrappy.simplesystems.org (scrappy.simplesystems.org [65.66.246.73]) by smtp.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id 2ABKp6Qw007917; Fri, 11 Nov 2022 14:51:06 -0600 (CST) Date: Fri, 11 Nov 2022 14:51:06 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@scrappy.simplesystems.org To: andy thomas cc: freebsd-fs@FreeBSD.org Subject: Re: Odd behaviour of two identical ZFS servers mirroring via rsync In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (GSO 67 2015-01-07) List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (smtp.simplesystems.org [65.66.246.90]); Fri, 11 Nov 2022 14:51:06 -0600 (CST) X-Rspamd-Queue-Id: 4N89pp15s5z4TrV X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7018, ipnet:65.64.0.0/13, country:US] X-ThisMailContainsUnwantedMimeParts: N On Fri, 11 Nov 2022, andy thomas wrote: > > It seems almost as if ZFS is not freeing up blocks when rsync has deleted or > shrank files, leaving unwanted blocks lurking around in the folder that 'du' > then discovers and adds to its tally when it works out the space usage of > that folder! This would be completely expected behavior if zfs snapshots are used. The rsync block sizes can be adjusted to be a better match for zfs block sizes (e.g. 128k). For example, zfs will do a 'sync' to write new data to disk and it will help if all of the data in an new/updated zfs block is provided at the time of the 'sync' (rather than 1/4 or 1/2 of the block). Network buffering can also be a factor since it effects the timing of data delivery to the backup server. If the sending side tends to stall, then add more buffering. Bob -- Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt