pg_upgrade too slow on vacuum phase

Поиск
Список
Период
Сортировка
От Kouber Saparev
Тема pg_upgrade too slow on vacuum phase
Дата
Msg-id CAN4RuQt+4J9zS1p4kwy_2P5nRG3eKJsHA16nLfePvFf6ZVcmZQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: pg_upgrade too slow on vacuum phase
Список pgsql-general
I am trying to upgrade PostgreSQL from 9.5 to 12 using pg_upgrade.

/usr/lib/postgresql/12/bin/pg_upgrade \
  --old-datadir=/var/lib/postgresql/9.5/main \
  --new-datadir=/var/lib/postgresql/12/main \
  --old-bindir=/usr/lib/postgresql/9.5/bin \
  --new-bindir=/usr/lib/postgresql/12/bin \
  --old-options '-c config_file=/etc/postgresql/9.5/main/postgresql.conf' \
  --new-options '-c config_file=/etc/postgresql/12/main/postgresql.conf' \
  --link \
  --jobs=16

It takes 47 minutes for the upgrade to finish (for a 28 GB database). It hangs on two particular steps:

Analyzing all rows in the new cluster                       ok
Freezing all rows in the new cluster                        ok

Which basically runs:

vacuumdb --all --analyze
vacuumdb --all --freeze

This is where all these 47 minutes are spent, yet I do not understand neither why, nor how I can improve this part. Can I skip it somehow and launch the vacuum manually afterwards?

Per postgresql.conf, I gave:

work_mem = 128MB
maintenance_work_mem = 8GB
max_parallel_maintenance_workers = 16
max_parallel_workers = 16

The server has 44 GB available memory, and 24 cores.

Do you have any ideas how to speed-up the entire process?

--
Kouber Saparev

В списке pgsql-general по дате отправления:

Предыдущее
От: Mariya Rampurawala
Дата:
Сообщение: Re: [EXTERNAL] Re: PostgreSQL-12 replication failover, pg_rewindfails
Следующее
От: Matthias Apitz
Дата:
Сообщение: ESQL/C: a ROLLBACK rolls back a COMMITED transaction