Thread: Why might it take so long to start up a cleanly-stopped instance?

Why might it take so long to start up a cleanly-stopped instance?

From
Ron Johnson
Date:
PG 14.15 on RHEL 7.9

This is a rather small system, and only one or two user connections existed at the time.

$ pg_ctl stop -wt9999 && pg_ctl start -wt9999
waiting for server to shut down........... done
server stopped
waiting for server to start.................................................................................................................................................................................................................................
2024-12-14 13:21:10.820 EST            24567            00000   LOG:  00000: redirecting log output to logging collector process
2024-12-14 13:21:10.820 EST            24567            00000   HINT:  Future log output will appear in directory "/var/log/postgresql".
2024-12-14 13:21:10.820 EST            24567            00000   LOCATION:  SysLogger_Start, syslogger.c:674
. done
server started

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
Ron Johnson <ronljohnsonjr@gmail.com> writes:
> $ pg_ctl stop -wt9999 && pg_ctl start -wt9999
> waiting for server to shut down........... done
> server stopped
> waiting for server to
>
start.................................................................................................................................................................................................................................2024-12-14
> 13:21:10.820 EST            24567            00000   LOG:  00000:
> redirecting log output to logging collector process
> 2024-12-14 13:21:10.820 EST            24567            00000   HINT:
>  Future log output will appear in directory "/var/log/postgresql".
> 2024-12-14 13:21:10.820 EST            24567            00000   LOCATION:
>  SysLogger_Start, syslogger.c:674
> . done
> server started

That's quite odd: the delay evidently happens before SysloggerStart,
which is done mighty early.  Perhaps strace'ing the start would yield
insight.

            regards, tom lane