Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtFB7-00BYWj-IH for pgsql-admin@arkaria.postgresql.org; Wed, 18 Oct 2023 22:38:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qtFB5-009d7a-Em for pgsql-admin@arkaria.postgresql.org; Wed, 18 Oct 2023 22:38:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtFB4-009d3G-U2 for pgsql-admin@lists.postgresql.org; Wed, 18 Oct 2023 22:38:11 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtFB1-0019qy-KE for pgsql-admin@lists.postgresql.org; Wed, 18 Oct 2023 22:38:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 939F5639FE; Wed, 18 Oct 2023 22:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1697668653; bh=L3M+SXH26iEvJL5aYG9G3+TMpg9HND7Qc7FHYNs9bzs=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=u5ROr1uRgObCBPGhkaUXe1nrf2lhjAKtWySgr7aldzlPsT1tZUCMjCBvdo8/zSICr qhUVdYw79NzZReoXyHBAgJ8xKC6vvur0/jZlO4MPd2427/IoofsG20wdNljfZIv4zb CR6Rcwu6ivyZhrnV8+IGJct0uKVO+Z0LLcJS49y89Xk6ugjxWrsE8lYJWcz/GFWO8d f7uez3ZfwIE2uqDajuJUf/ZwSSKVPqHJNWy0pMQ1ZVNUhEY2BbESYGM2DVUGnsxPj5 8Z44AOBHAN+fpMQCnMbU0k+kzooQsJnpO/pHHDdKEm2VBj8WKTrNxSe8dTbSxLqvQy pLZtzD0qaUTQQ== X-Virus-Scanned: Debian amavisd-new at emo09-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo09-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZzG0eeUPzWZu; Wed, 18 Oct 2023 22:37:33 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id D1B51639BC; Wed, 18 Oct 2023 22:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1697668652; bh=L3M+SXH26iEvJL5aYG9G3+TMpg9HND7Qc7FHYNs9bzs=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=bKxiGKCOql3lJ9oy/GQdHzZmq3BCyxETG/i61JnjEpphSfaT50CEqyHnNVfuvJ21x dwRLsrx227YPFtSGIxUVf16rSnZKya2SqNB6kQ7WR5uwzioE6ceYPmq4QqKwoIjP6N 6AkPr2R5CBZNqtO7qMrresU520mNftcxZP+yodvYOXHDR5200zmeVCO0GPBxtWikgR gOFnsCwh1Kr4FqbcafESWv97RTP1Pw4+gW1GR5YtGljZ1GMsZUvQtQzQlSu2Qmb9UL TuqvcQYkak+hCjeK6V65ISd0mJiUEgH/MOjEEjg4/SEbq3Iz/mA0aCCNYkJu3CHIxT WOOcBLlFUYHrQ== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.100.2.1.4\)) Subject: Re: pg_dump -Z6 (the default) can be pretty slow From: Scott Ribe In-Reply-To: Date: Wed, 18 Oct 2023 16:37:22 -0600 Cc: Pgsql-admin Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Ron X-Mailer: Apple Mail (2.3774.100.2.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk If you can use the directory format, then you can use multiple jobs to = really speed up compressed dump (and restore). Also, I'd suggest trying a run with lz4 compression--lz4 is particularly = good at not slowing down when it encounters already-compressed data. = Doesn't give really high compression ratios, but since you're already at = -Z3, might be worth comparing. (Personally, I stay away from zstd, as I've seen it create malformed = backups because the encoder crashes with out-of-memory.) -- Scott Ribe scott_ribe@elevated-dev.com https://www.linkedin.com/in/scottribe/ > On Oct 18, 2023, at 4:30=E2=80=AFPM, Ron = wrote: >=20 > In preparation for moving from 9.6 to something supported, I ran a = pg_dump/pg_restore test (since the migrated databases will be on new = servers, and we purge off old partitions and add new partitions, = pg_upgrade and logical replication are off the table). >=20 > (The servers are VMs on ESX hosts, and on the same subnet.) >=20 > Our databases are chock full of bytea fields holding compressed = images. pg_dump -Fd -Z6 took 25 minutes, and 5.5GB disk space. = (remember, it's a test!), while pg_dump -Fd -Z0 only took 90 seconds, = but consumed 15GB. >=20 > This isn't really surprising to anyone who's ever tried to gzip a jpg = file... >=20 > Quite the speed increase if you can swallow the increased disk usage. >=20 > pg_dump -Z3 did the best: only 8.5 minutes, while using just 5.8GB = disk space. >=20 > --=20 > Born in Arizona, moved to Babylonia. >=20 >=20