<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop" -->

---
title: The Insatiable Postgres Replication Slot | daily.dev
description: An investigation into unexpected disk space exhaustion on an Amazon RDS Postgres instance caused by an inactive logical replication slot. The root cause is a...
canonical: https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Insatiable Postgres Replication Slot | daily.dev
og:description: An investigation into unexpected disk space exhaustion on an Amazon RDS Postgres instance caused by an inactive logical replication slot. The root cause is a...
og:url: https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop
og:image: https://api.daily.dev/og/posts/NAp6XAVoP.png
og:image:alt: The Insatiable Postgres Replication Slot
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Insatiable Postgres Replication Slot

**[Gunnar Morling](https://daily.dev/sources/gunnar-morling)** · 6 min read · 0 upvotes · 0 comments

## Summary

An investigation into unexpected disk space exhaustion on an Amazon RDS Postgres instance caused by an inactive logical replication slot. The root cause is a combination of three factors: RDS writes heartbeats to an internal rdsadmin database every 5 minutes, RDS configures the WAL segment size to 64 MB (vs. the default 16 MB), and the archive_timeout parameter forces a new WAL segment every 5 minutes when there is any database activity. An inactive replication slot retains all these 64 MB WAL segments, leading to ~18 GB/day of disk growth on an otherwise idle database. The fix is to never leave replication slots unattended, set up alerts on WAL retention per slot, and use pg_logical_emit_message() to periodically advance an otherwise stalled slot.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.morling.dev/blog/insatiable-postgres-replication-slot/>

## Similar posts on daily.dev

- [All Your GUCs in a Row: idle\_replication\_slot\_timeout](https://daily.dev/posts/all-your-gucs-in-a-row-idle-replication-slot-timeout-5ezg0va9j) · Planet PostgreSQL · 0 upvotes · 1 comments
- [The Night Our Tables Wouldn't Stop Growing](https://daily.dev/posts/the-night-our-tables-wouldn-t-stop-growing-pvfggogkk) · Planet PostgreSQL · 1 upvotes · 0 comments
- [When Patroni Silently Deletes Your Replication Slots](https://daily.dev/posts/when-patroni-silently-deletes-your-replication-slots-elvtrgz86) · Planet PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#postgresql](https://daily.dev/tags/postgresql), [#debezium](https://daily.dev/tags/debezium)

[View this post on daily.dev](https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Insatiable Postgres Replication Slot","url":"https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop"},"datePublished":"2026-03-16T08:14:53.245Z","dateModified":"2026-03-16T08:22:37.257Z","description":"An investigation into unexpected disk space exhaustion on an Amazon RDS Postgres instance caused by an inactive logical replication slot. The root cause is a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ac20098c1b81695e474c9c9aae219929?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ac20098c1b81695e474c9c9aae219929?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Gunnar Morling","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Gunnar Morling","logo":"https://media.daily.dev/image/upload/s--77UJH_xq--/f_auto,q_auto/v1773648773/logos/gunnar-morling?_a=BAMAMiiu0","url":"https://daily.dev/sources/gunnar-morling"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-insatiable-postgres-replication-slot-nap6xavop","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"aws,postgresql,debezium","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gunnar Morling","item":"https://daily.dev/sources/gunnar-morling"},{"@type":"ListItem","position":3,"name":"The Insatiable Postgres Replication Slot"}]}
```

