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 1qtFr3-00BcAz-8l for pgsql-admin@arkaria.postgresql.org; Wed, 18 Oct 2023 23:21:33 +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 1qtFr0-009x2t-S6 for pgsql-admin@arkaria.postgresql.org; Wed, 18 Oct 2023 23:21:31 +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 1qtFr0-009x2J-Ga for pgsql-admin@lists.postgresql.org; Wed, 18 Oct 2023 23:21:31 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qtFqu-001AFf-8p for pgsql-admin@lists.postgresql.org; Wed, 18 Oct 2023 23:21:29 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-5a7db1f864bso88317907b3.3 for ; Wed, 18 Oct 2023 16:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697671283; x=1698276083; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ih98eHKJRdxM2svHv5ncymsOhv40Fj8BAsBc87JsRmc=; b=RTdjkNJhoO4gigjZ8gYRphcVh8pg4XgO4H+hGewMY3TNVAsEQRsiuAksU5Vu+CSX74 m9CrWLQVSg0qXLODofKDrie7mQYKor0AJI2U4CwYofkQsLIL/5TSmWmRlUXGA4EjLyRY 7K4t5vxwbSFyanBP9InorWN67nQ+vD5FckHeiKuS4Q1Ua0QfO+s54jBrUSiIb0JdKlr6 13d6ESGaV6SR06nf8W5thP8hYnj+pLkWY/POAo4CNyO9BY+IoLI6OnE2wip93Z7GCIGp mIBgv/4ZIvnHwjyYmfrm9MyOgakw1wNnYizJmL6l1gypi+RP9Tdr2tvaMUtrZqF8i5AG T1mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697671283; x=1698276083; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ih98eHKJRdxM2svHv5ncymsOhv40Fj8BAsBc87JsRmc=; b=Sca6hYEXrB8C7CRq9y5mAXqfVc7vb4zUAjYcIxpyhVLj8oNxrnGp0wMnt4EtSsqnE9 ZHVuWe7QBp02ZyMsX/gRFCF3V4LEN2IFc4pLM2OOR+qnyMV6AXhD+nZ4ZJlV5U6NIU4G Fbkda6ZzG0MaZHQYyz7fyxTSeKczPx0zjfgmrzxjU6lrcWdJ658LT3t5q4KOzlI9ONhT 8UX92GD9Rq5G3DtQe9sa75P4MBBS66MSVqlg6xW30eDW8musBaZOFuIACaU8nrI8dfMb 2PJVRHxlpknF29plT4VxksSrqZWo9n6TCToF6mfcMclgi5xBqLUGUnHxuHMU8jeG32wi W7BA== X-Gm-Message-State: AOJu0Yxe240ajRbXCE2UFwBxRGIssvK6MtIjKIYgyI4W1irZX+YOEUWX D2uvJm/J7ZJp8Lr41TWujhHx0RumUHY= X-Google-Smtp-Source: AGHT+IE2vOMnAqjHwSc8BxoX76K0nBMQlMX/hVpQyzmSMrS3Y+cZv3alVxa6WXk5xNf0dJbOqaQOjA== X-Received: by 2002:a0d:dbcb:0:b0:5a7:db27:7794 with SMTP id d194-20020a0ddbcb000000b005a7db277794mr794177ywe.25.1697671283164; Wed, 18 Oct 2023 16:21:23 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:3d15:81b3:3a0:4d09? ([2600:1700:bd2c:b810:3d15:81b3:3a0:4d09]) by smtp.googlemail.com with ESMTPSA id u13-20020a81a50d000000b005a7b8fddfedsm1902599ywg.41.2023.10.18.16.21.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Oct 2023 16:21:22 -0700 (PDT) Message-ID: Date: Wed, 18 Oct 2023 18:21:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_dump -Z6 (the default) can be pretty slow Content-Language: en-US To: Pgsql-admin References: From: Ron In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/18/23 17:37, Scott Ribe wrote: > If you can use the directory format, then you can use multiple jobs to really speed up compressed dump (and restore). It didn't occur to me to mention that I used it.  Do people really still not use -Fd? > 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. I'm still using 9.6, so that feature isn't available yet.  When I get the Pg 15 VMs stood up (Pg15 binaries are not available for RHEL 6), I'm definitely going to try that. > (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 PM, Ron wrote: >> >> 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). >> >> (The servers are VMs on ESX hosts, and on the same subnet.) >> >> 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. >> >> This isn't really surprising to anyone who's ever tried to gzip a jpg file... >> >> Quite the speed increase if you can swallow the increased disk usage. >> >> pg_dump -Z3 did the best: only 8.5 minutes, while using just 5.8GB disk space. >> >> -- >> Born in Arizona, moved to Babylonia. >> >> -- Born in Arizona, moved to Babylonia.