public inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: Babak Ghadiri <bbkghadiri6@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Parallelizing startup with many databases
Date: Fri, 2 Jan 2026 11:25:07 +0330
Message-ID: <CAEkHFKSxYO7Ryv_UNNGSe88zosg0_Q_dop6hXN0oCoYK28EZtA@mail.gmail.com> (raw)

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.

I would like to ask:

- Is the largely single-threaded startup behavior a fundamental
architectural
  constraint (e.g. catalog dependencies, locking, recovery ordering), or
mainly
  an unimplemented optimization?
- Are there any existing discussions, patches, versions (18+) to
parallelize parts of startup or otherwise improve startup scalability with
many databases?
- Are there any PostgreSQL configuration settings known to dramatically
reduce startup time, or is startup performance mostly fixed by architecture
in this scenario?

I understand that having many databases in a single cluster is not the most
common or recommended multi-tenant model, but this is an existing system and
I’m trying to better understand the current limits and future direction.

Thank you for your time and insights.

Best regards.


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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bbkghadiri6@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Parallelizing startup with many databases
  In-Reply-To: <CAEkHFKSxYO7Ryv_UNNGSe88zosg0_Q_dop6hXN0oCoYK28EZtA@mail.gmail.com>

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

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