Re: pg_restore mostly idle on restoring a large number of tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_restore mostly idle on restoring a large number of tables
Дата
Msg-id 3614137.1689443773@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_restore mostly idle on restoring a large number of tables  (Boris Sagadin <boris@infosplet.com>)
Список pgsql-general
Boris Sagadin <boris@infosplet.com> writes:
> restoring a 1.5TB database with about 800k tables on i3.4xlarge AWS
> instace, PgSQL V12.15 on Ubuntu.

> Running pg_restore with -j 16, I noticed the pg_restore is busy for an hour
> or so with IO at 80%+ and then most of processes start idling and only a
> few doing some work, disk IO at 1-2%, pg_stat_activity is mostly idle, same
> goes for CPU, and this state proceeds for further 6 hours, disk space
> increases very slowly.

Yeah, this seems like a performance bug in pg_restore, per analysis at
[1].  Until somebody gets around to doing something about that, I'd
counsel not bothering with parallelized restore for this many tables.

If the tables are mostly small, it'd likely be more useful to use
--single-transaction mode; though you'd have to make sure that
max_locks_per_transaction is set high enough to allow creating all
those tables in one transaction.

            regards, tom lane

[1] https://www.postgresql.org/message-id/3612876.1689443232%40sss.pgh.pa.us



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

Предыдущее
От: Priyank Rajvansh
Дата:
Сообщение: Re: error in the example given for numeric data types
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: error in the example given for numeric data types