Skip to content
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

Eliminate unnecessary encoding of TXT records when they will not be put into the final DNS response #5271

Closed
mkeeler opened this issue Jan 25, 2019 · 0 comments · Fixed by #5272
Assignees
Labels
theme/dns Using Consul as a DNS provider, DNS related issues theme/performance Performance benchmarking or potential improvement type/bug Feature does not function as expected
Milestone

Comments

@mkeeler
Copy link
Member

mkeeler commented Jan 25, 2019

The fix for issue 4354 in PR 4362 had some unintended consequences that cause an increase in CPU utilization of Consul's DNS server.

TXT recording encoding was changed to be done unconditionally in formatNodeRecord and then returned so that callers could determine whether to place them in the additional section or the answer section of the response.

In many cases these records are simply discarded. In those cases we are still paying the penalty of generating them which happens to involve quite a bit of regular expression work to encode the key/value TXT records.

The solution is to determine if those TXT records would be used at all and simply not generate them in the first place. This should produce a minor reduction in CPU cycles of each DNS request with results that include node metadata. While a relatively small per request overhead, on agents with high DNS request rates the aggregate CPU utilization would be noticeable.

@mkeeler mkeeler self-assigned this Jan 25, 2019
@mkeeler mkeeler added type/bug Feature does not function as expected theme/dns Using Consul as a DNS provider, DNS related issues theme/performance Performance benchmarking or potential improvement labels Jan 25, 2019
@mkeeler mkeeler added this to the Upcoming milestone Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/dns Using Consul as a DNS provider, DNS related issues theme/performance Performance benchmarking or potential improvement type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant