Re: Parallelizing startup with many databases - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Parallelizing startup with many databases
Date
Msg-id CAGECzQSu1BeW3EvRwUWGYL+EBHzDhLCRW3LKcqTU-Y4_44myZA@mail.gmail.com
Whole thread Raw
In response to Parallelizing startup with many databases  (Babak Ghadiri <bbkghadiri6@gmail.com>)
Responses Re: Parallelizing startup with many databases
List pgsql-hackers


On Fri, Jan 2, 2026, 08:55 Babak Ghadiri <bbkghadiri6@gmail.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. 




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

pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: Speed up ICU case conversion by using ucasemap_utf8To*()
Next
From: Tatsuo Ishii
Date:
Subject: Re: Row pattern recognition