Re: pg_dump Running Slow

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Yongye Serkfem <yserkfem(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump Running Slow
Date: 2024-01-16 19:18:37
Message-ID: 117051a7-9f97-4ae2-92fd-28ad5547df8e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 1/16/24 10:55 AM, Yongye Serkfem wrote:
> Hello Engineers,
> I trust you are all doing well. I need help on how to improve the
> speed of pg_dump. I took a pg_dump on a 1TB database, which took
> almost a whole day. I used this command: "pg_dump -U postgres -d
> dynamic -f /backups/." Also, how do I check on the progression of the
> process?

https://www.postgresql.org/docs/current/app-pgdump.html

"
||
|j /|njobs|/|
|--jobs=/|njobs|/|

Run the dump in parallel by dumping /|njobs|/ tables simultaneously.
This option may reduce the time needed to perform the dump but it
also increases the load on the database server. You can only use
this option with the directory output format because this is the
only output format where multiple processes can write their data at
the same time.

pg_dump will open /|njobs|/ + 1 connections to the database, so make
sure your max_connections
<https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS>
setting is high enough to accommodate all connections.

<...>

"

"

|-v|
|--verbose|

Specifies verbose mode. This will cause pg_dump to output detailed
object comments and start/stop times to the dump file, and progress
messages to standard error. Repeating the option causes additional
debug-level messages to appear on standard error.||

|"|

>
> Sincerely your
> Yongye Serkfem

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-01-16 19:24:32 Re: Mimic ALIAS in Postgresql?
Previous Message David Ventimiglia 2024-01-16 19:16:19 Re: How to redirect output from PostgreSQL pg_recvlogical to a file or a pipe?