Skip to content

Commit a89b044

Browse files
authored
Merge pull request #785 from cfbraun/master
fix: reduce StaleKeyLifetimeSec to 4 minutes
2 parents 013a9bd + 14372d6 commit a89b044

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/target/remote/remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (rt *Target) Init(cfg *config.Map) error {
146146
MaxKeys: 5000,
147147
MaxConnsPerKey: 5, // basically, max. amount of idle connections in cache
148148
MaxConnLifetimeSec: 150, // 2.5 mins, half of recommended idle time from RFC 5321
149-
StaleKeyLifetimeSec: 60 * 5, // should be bigger than MaxConnLifetimeSec
149+
StaleKeyLifetimeSec: 60 * 4, // make sure that cleanup runs before recommended idle time from RFC 5321
150150
}
151151
cfg.Int("conn_max_idle_count", false, false, 5, &poolCfg.MaxConnsPerKey)
152152
cfg.Int64("conn_max_idle_time", false, false, 150, &poolCfg.MaxConnLifetimeSec)

internal/target/remote/remote_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func testTarget(t *testing.T, zones map[string]mockdns.Zone, extResolver *dns.Ex
6464
MaxKeys: 5000,
6565
MaxConnsPerKey: 5, // basically, max. amount of idle connections in cache
6666
MaxConnLifetimeSec: 150, // 2.5 mins, half of recommended idle time from RFC 5321
67-
StaleKeyLifetimeSec: 60 * 5, // should be bigger than MaxConnLifetimeSec
67+
StaleKeyLifetimeSec: 60 * 4, // make sure that cleanup runs before recommended idle time from RFC 5321
6868
}),
6969
}
7070

0 commit comments

Comments
 (0)