Skip to content

Commit 5a20243

Browse files
authored
Fix TCP keepalive configuration (#77)
Fix key name inconsistency: the inner guard checked "tcpKeepalives" (plural) while the value rendered `.Values.tcpKeepalive` (singular), causing `keepalive = <no value>` when `tcpKeepalives` was set. Standardize on singular to match Linux convention (`SO_KEEPALIVE`, `tcp_keepalive_time`) and the pgdog TOML key. Also fix commented-out defaults in `values.yaml` and `README.md`: `tcpTime` and `tcpInterval` were in seconds (Linux kernel defaults) but pgdog expects milliseconds.
1 parent 0488105 commit 5a20243

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,14 @@ Configure socket-level TCP keep-alive behavior (optional):
255255

256256
```yaml
257257
tcpKeepalive: true
258-
tcpTime: 7200 # Time (in seconds) before first keepalive probe
259-
tcpInterval: 75 # Interval (in seconds) between keepalive probes
258+
tcpTime: 7200000 # 2 hours (ms) before first keepalive probe
259+
tcpInterval: 75000 # 75 seconds (ms) between keepalive probes
260260
tcpRetries: 9 # Number of keepalive probes before connection is dropped
261261
```
262262

263263
These settings control the TCP keep-alive behavior for database
264-
connections. If not specified, system defaults are used.
264+
connections. All time values are in milliseconds. If not specified,
265+
system defaults are used.
265266

266267
## Contributions
267268

templates/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ data:
239239
240240
{{- if or (hasKey .Values "tcpKeepalive") (hasKey .Values "tcpTime") (hasKey .Values "tcpInterval") (hasKey .Values "tcpRetries") }}
241241
[tcp]
242-
{{- if hasKey .Values "tcpKeepalives" }}
242+
{{- if hasKey .Values "tcpKeepalive" }}
243243
keepalive = {{ .Values.tcpKeepalive }}
244244
{{- end }}
245245
{{- if hasKey .Values "tcpTime" }}

values.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,11 @@ control:
470470
# lsnCheckInterval: 1000 # How frequently to re-fetch replication status
471471

472472
# TCP keep-alive configuration (optional)
473-
# These settings control socket-level keep-alive behavior
474-
# tcpKeepalives: true
475-
# tcpTime: 7200
476-
# tcpInterval: 75
473+
# These settings control socket-level keep-alive behavior.
474+
# All time values are in milliseconds.
475+
# tcpKeepalive: true
476+
# tcpTime: 7200000 # 2 hours (Linux default: 7200s)
477+
# tcpInterval: 75000 # 75 seconds (Linux default: 75s)
477478
# tcpRetries: 9
478479

479480
# Memory configuration (optional)

0 commit comments

Comments
 (0)