pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: senor <frio_cervesa@hotmail.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_upgrade --jobs
Date: Sat, 6 Apr 2019 21:26:46 +0000
Message-ID: <BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com> (raw)
In-Reply-To: <1c0469fb-1878-35ac-8468-78ce47299638@aklaver.com>
References: <BYAPR01MB370142138620DE0D3DD6120BF7520@BYAPR01MB3701.prod.exchangelabs.com>
	<1c0469fb-1878-35ac-8468-78ce47299638@aklaver.com>

Thank you for responding. I did see that note and should have included that as part of my question.

Since pg_upgrade is in control of how it is calling pg_dump, is there a reason pg_upgrade cannot use the directory output format when calling pg_dump? Is the schema-only operation incompatible?

________________________________________
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Saturday, April 6, 2019 1:52 PM
To: senor; pgsql-general@lists.postgresql.org
Subject: Re: pg_upgrade --jobs

On 4/6/19 11:44 AM, senor wrote:
> The pg_upgrade --jobs option is not passed as an argument when it calls pg_dump. I haven't found anything in docs or forums mentioning a reason for not supporting under certain circumstances other than possibly for pre-9.2. The pg_upgrade docs page states that it allows multiple CPUs to be used for dump and reload of schemas. Some databases I'm upgrading have 500,000+ tables and running with a single process is greatly increasing the upgrade time.
>
> I am also using the --link option.
> I have tried "--jobs 20", "--jobs=20", placing this option first and last and many other variations.
> I am upgrading 9.2.4 to 9.6.12 on CentOS 6.
> Varying hardware but all with 32+ CPU cores.
>
> su - postgres -c "/usr/pgsql-9.6/bin/pg_upgrade --jobs=20 --link \
>         --old-bindir=/usr/pgsql-9.2/bin/ \
>         --new-bindir=/usr/pgsql-9.6/bin/ \
>         --old-datadir=/var/lib/pgsql/9.2/data/ \
>         --new-datadir=/var/lib/pgsql/9.6/data/"
>
> I feel like there's a simple reason I've missed but this seems pretty straight forward.

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

"--jobs=njobs

     Run the dump in parallel by dumping njobs tables simultaneously.
This option reduces the time of 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."


> A secondary plan would be to find instructions for doing the same as "pg_upgrade --link" manually so I can run "pg_dump --jobs 20".
> Any assist is appreciated.
> Thanks,
> S. Cervesa
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com





view thread (15+ messages)  latest in thread

Message-ID: <BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com>
Permalink:  ../BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com/
Also on:    postgresql.org/message-id/BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: frio_cervesa@hotmail.com
  Subject: Re: pg_upgrade --jobs
  In-Reply-To: <BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com>
  References: <BYAPR01MB370142138620DE0D3DD6120BF7520@BYAPR01MB3701.prod.exchangelabs.com> <1c0469fb-1878-35ac-8468-78ce47299638@aklaver.com> <BYAPR01MB370161A441B39513EF47FE5AF7520@BYAPR01MB3701.prod.exchangelabs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox