Switch to enableHRTimer -- improve request-release timing accuracy#217
Switch to enableHRTimer -- improve request-release timing accuracy#217htuch merged 21 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
|
For best results, libevent needs to be made aware too that we'd like to use precise timers. |
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Prerequisite to envoyproxy#217 Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
|
readying this up for review, as we are closing in on landing all the prerequisites to this. |
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
|
/assign htuch |
| // The upside of the approach below is that we are very loosely coupled and have a one-liner. | ||
| // Getting to libevent for the other approach is going to introduce more code as we would need to | ||
| // derive our own customized versions of certain Envoy concepts. | ||
| putenv(const_cast<char*>("EVENT_PRECISE_TIMER=1")); |
There was a problem hiding this comment.
Is it safe to change this at runtime? It seems to be relying on the fact that libevent isn't caching this value or using it for its own setup. Should we at least push it to prior to wherever we initialize libevent?
There was a problem hiding this comment.
So libevent applies this here.
So I think this is safe / in time for the workers. But I do agree earlier is less risky going forward. Let me see what I can do there.
There was a problem hiding this comment.
(doing this early makes this a little more resilient to changes, and would also make this apply to the dispatcher we use above)
There was a problem hiding this comment.
Yeah, this is better. I'm still a bit sketched by using env vars here, but let's see how it goes.
htuch
left a comment
There was a problem hiding this comment.
Generally looks good, just one question..
/wait
source/common/sequencer_impl.cc
Outdated
| const auto now = last_event_time_ = time_source_.monotonicTime(); | ||
| const auto now = time_source_.monotonicTime(); | ||
| const auto running_duration = now - start_time_; | ||
| last_event_time_ = now; |
There was a problem hiding this comment.
What's the reason for this change?
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
|
@htuch backed out the no-op change, and moved the |
| // The upside of the approach below is that we are very loosely coupled and have a one-liner. | ||
| // Getting to libevent for the other approach is going to introduce more code as we would need to | ||
| // derive our own customized versions of certain Envoy concepts. | ||
| putenv(const_cast<char*>("EVENT_PRECISE_TIMER=1")); |
There was a problem hiding this comment.
Yeah, this is better. I'm still a bit sketched by using env vars here, but let's see how it goes.
* save state on ramping rate limiter Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Add tests, clean up Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Refactor + LinearlyOpeningRateLimiterFilter Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * save state Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * save state Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Back out change to constness in Frequency Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Save state, wire in zipf / foo ZipfRateLimiter Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Some comments & tidying up Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * small cleanup Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Update Envoy dep for access to enableHRTimer() Prerequisite to #217 Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Whoops, amend bad copying Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Also, sync .bazelrc while at it Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review feedback Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Clean up the diff Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Update Envoy to the latest Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Move to the sha that has our target Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Unbreak it Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Fix a TODO Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Fix accidental comment Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Fix clang-tidy issue Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Zipf: expose q and v arguments of the distribution Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Zipf: expose q and v arguments of the distribution Also, add a test, and doc comments Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Remove zipf stuff Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review feedback Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review: 1ns adjustment - Back out 1 ns adjustment - Update test to use microsecond step resolution now that we can - Add comment with explanation Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review: partially address comments - Check expectations on the distribution argument to GraduallyOpeningRateLimiterFilterTest - Clean up the computation in GraduallyOpeningRateLimiterFilter - Add a bunch of explanatory comments What's left is getting easy to grok numbers in test expectations. Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review-feedback: use second law of motion Instead of matching hard-coded expectations for release timings, use the second law of motion as a control method for verifying the acquisition timings the rate limiter. Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * clang-tidy: fix complaint Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com> * Review feedback Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Improves accuracy of request-release timings when the sequencer cannot use spinning.
Requirement on the Envoy side needs to go in first:
Signed-off-by: Otto van der Schaaf oschaaf@we-amp.com