max_replication_slots
| 버전 | 기본값 | context | 타입 |
|---|---|---|---|
| 14 | 10 | postmaster (재시작) | integer |
| 15 | 10 | postmaster (재시작) | integer |
| 16 | — | user | integer |
| 17 | — | user | integer |
| 18 | 10 | postmaster (재시작) | integer |
| 19 | 10 | postmaster (재시작) | integer |
서버가 지원할 수 있는 replication slot의 최대 개수를 정한다. 기본값은 10이며, 이 파라미터는 서버를 시작할 때만 설정할 수 있다.
replication slot은 standby나 logical 구독자가 아직 받아 가지 않은 WAL을 primary가 미리 정리하지 않도록 붙잡아 두는 장치다. 이 값을 현재 존재하는 replication slot 수보다 낮게 설정하면 서버가 시작되지 않는다. 또한 replication slot을 쓰려면 wal_level이 replica 이상이어야 한다.
운영 노트: replication slot은 소비자가 멈춰 있으면 WAL을 무한정 붙잡아 디스크를 채울 수 있다. 사용하지 않는 slot은 제때 정리하고, slot이 밀린 WAL 양(
pg_replication_slots)을 주기적으로 모니터링하는 것이 안전하다.출처: PostgreSQL 18 문서