I'm running postgresql 11 using the official postgresql docker image. The configuration is the default one without any tweak. Sometimes, my docker server crashes and kills all the container with it. As a result the postgresql gets stopped in a dirty way and postgresql has to replay the WALs. It takes more than 1h to replay the logs thought the server is mostly idling. I mean when the server crashed it hardly had any writes in the logs. And when I check in pg_wal I only see 65mb of data in the directory so it shouldn't take so much time to replay.
Here's some configurations:
max_wal_size: 1gb min_wal_size: 80gb checkpoint_timeout: 3min
So how come it take so long to restart? I have a different server with much less databases but similar configurations. Both are mostly idle all the time but the other one quickly restart while they have the same configuration.