Skip to content

fix: reduce StaleKeyLifetimeSec to 4 minutes #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/target/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (rt *Target) Init(cfg *config.Map) error {
MaxKeys: 5000,
MaxConnsPerKey: 5, // basically, max. amount of idle connections in cache
MaxConnLifetimeSec: 150, // 2.5 mins, half of recommended idle time from RFC 5321
StaleKeyLifetimeSec: 60 * 5, // should be bigger than MaxConnLifetimeSec
StaleKeyLifetimeSec: 60 * 4, // make sure that cleanup runs before recommended idle time from RFC 5321
}
cfg.Int("conn_max_idle_count", false, false, 5, &poolCfg.MaxConnsPerKey)
cfg.Int64("conn_max_idle_time", false, false, 150, &poolCfg.MaxConnLifetimeSec)
Expand Down
2 changes: 1 addition & 1 deletion internal/target/remote/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func testTarget(t *testing.T, zones map[string]mockdns.Zone, extResolver *dns.Ex
MaxKeys: 5000,
MaxConnsPerKey: 5, // basically, max. amount of idle connections in cache
MaxConnLifetimeSec: 150, // 2.5 mins, half of recommended idle time from RFC 5321
StaleKeyLifetimeSec: 60 * 5, // should be bigger than MaxConnLifetimeSec
StaleKeyLifetimeSec: 60 * 4, // make sure that cleanup runs before recommended idle time from RFC 5321
}),
}

Expand Down