Limit how often a busy tunnel can requery the lighthouse #940
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Active tunnels cause nebula to re-query the lighthouse every so often, roughly every 5k packets, to make sure we are using the best remote ip address possible for the remote host. On busy tunnels this limit can be hit very quickly and cause unnecessary load on the lighthouses.
This change adds a way to limit the minimum amount of time before the next query is allowed.
timers.requery_wait_seconds
is set to 60 seconds by default and relies on the original counter behavior prior to evaluation. This means an infrequently active tunnel could miss a re-query if the stars align just right.This also moves the try promote and re-query every counter to config options for a matter of completeness. Initial performance tests look equivalent but I am not opposed to only adding the 1 new config option and leaving the 2 old items as constants.