k6
k6 copied to clipboard
DNS TTL not Expiring
When running the k6 tool with
export let options = {
dns: {
ttl: '0',
select: 'roundRobin',
policy: 'any'
},
The TTL value of '0' is not honored until after the first transaction expires at 30 seconds.
Environment
- k6 version:
- v0.30.0
- OS and version:
- linux 5.0.0
Expected Behavior
The expected behavior is that the DNS TTL session should be reset on every call.
Actual Behavior
The initial TTL call caches the first IP returned and didn't expire until after 30 seconds. Then k6 starts behaving normally.
Steps to Reproduce the Problem
- Create a k6 script with the options object set to the below value
export let options = {
dns: {
ttl: '0',
select: 'roundRobin',
policy: 'any'
},
vus: 10,
duration: '30s',
}
- Be sure to run this against this an Active-Active setup. This will properly show in metrics where only one site will receive the initial run of traffic.
Hi, thanks for reporting this.
Are you using HTTP keep-alive? As mentioned in the documentation k6 will keep a connection open if keep-alive is in use, so the only way to force any DNS resolver strategy is to disable it with the noConnectionReuse option.
Can you give that a try and let us know if the issue persists?
This has been awaiting response from @Salamandastron1 for over a year. I would like to close it unless the user confirms that this isn't due to keep-alive connections