on-internet
← Community

PostgreSQL pg_prewarm: checking autoprewarm readiness on startup

Stack Overflow ·

My team and I run Postgres 14–18 on Kubernetes with pg_prewarm in shared_preload_libraries (pg_prewarm.autoprewarm = on, pg_prewarm.autoprewarm_interval = 300s). On large instances, autoprewarm takes 20+ minutes to reload $PGDATA/autoprewarm.blocks after a restart. During rolling restarts, we want our Kubernetes startup probe to keep a replica out of rotation until autoprewarm finishes its initial load, so it doesn't get hit with live traffic on a cold cache. The catch is that pg_prewarm doesn't seem to expose any SQL view or function to check if the initial preload is done, and every simple c

Comments

Sign in or sign up to comment and upvote.

No comments yet.