Re: Parallelizing startup with many databases

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Babak Ghadiri <bbkghadiri6(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Parallelizing startup with many databases
Date: 2026-01-03 00:58:25
Message-ID: CAGECzQSu1BeW3EvRwUWGYL+EBHzDhLCRW3LKcqTU-Y4_44myZA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Fri, Jan 2, 2026, 08:55 Babak Ghadiri <bbkghadiri6(at)gmail(dot)com> wrote:

> Hello,
> I hope you are doing well.
>
> In PostgreSQL 16, startup appears to initialize databases sequentially and
> primarily uses a single CPU core. In clusters with a very large number of
> databases (around 5,000 in our case), this results in noticeably long
> startup times after restarts or crash recovery.
>

You probably want to consider setting:
recovery_init_sync_method=syncfs

I'm 99% certain that that will solve your problem.

https://www.postgresql.org/docs/current/runtime-config-error-handling.html

https://www.postgresql.org/message-id/flat/11bc2bb7-ecb5-3ad0-b39f-df632734cd81(at)discourse(dot)org

PS It took me way to long to find that setting. I think we should move it
from the error handling docs page to the page with all of the other
recovery settings.
https://www.postgresql.org/docs/current/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY

>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Andreas Karlsson 2026-01-03 19:09:00 Re: Parallelizing startup with many databases
Previous Message Tom Lane 2026-01-03 00:02:27 Re: Parallelizing startup with many databases

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-01-03 01:04:54 Re: Row pattern recognition
Previous Message Andreas Karlsson 2026-01-03 00:40:36 Re: Speed up ICU case conversion by using ucasemap_utf8To*()