ehancement(sources): Add keepalive.max_connection_age_secs config option to HTTP-server sources#19141
Conversation
|
Your preview site for the VRL Playground will be ready in a few minutes, please allow time for it to build. Heres your preview link: |
|
Your preview site for the vector.dev will be ready in a few minutes, please allow time for it to build. Heres your preview link: |
|
Your preview site for the Rust Doc will be ready in a few minutes, please allow time for it to build. Heres your preview link: |
There was a problem hiding this comment.
Awesome! This is a nice addition on its own, but I think we discussed that Vector should close the connection, itself, after sending the response with this header. Do you still plan to implement that?
Additionally, yes, I was thinking about making this a default for at least the Datadog Agent source.
I'd like to have someone else do a more detailed review (maybe @bruceg?). My review was more high-level and focused on UX.
| Some(&HeaderValue::from_static("foo")) | ||
| ); | ||
| } | ||
|
|
Correct HTTP client implementations will close the connection when they receive the |
I looked into this a bit more. The hyper server actually takes care of gracefully closing the connection for us as well, so there's nothing else we have to do here 🙂 https://github.com/hyperium/hyper/blob/6fd696e10974f10b2c6b9d16393bbbfa21c2333f/src/proto/h1/role.rs#L798 |
Datadog ReportBranch report: ✅ |
| start_reference: Instant, | ||
| max_connection_age: Duration, |
There was a problem hiding this comment.
Would it be worth storing the end reference instead of the start plus an age? i.e. store Instant::now() + max_connection_age
There was a problem hiding this comment.
The start reference and age are useful information to put in the debug log in my opinion.
Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
Aha, nice! It might be worth testing that behavior, if it is easy, since it would not be obvious to me that |
The following test indirectly asserts that the connection is reset by asserting that the With that being said, it would good to add an integration test that verifies this behavior as well. I can look into that in a follow-up PR. |
Regression Detector ResultsRun ID: b70e9a32-91cb-4d9e-b8e4-212c80c28365 ExplanationA regression test is an integrated performance test for Because a target's optimization goal performance in each experiment will vary somewhat each time it is run, we can only estimate mean differences in optimization goal relative to the baseline target. We express these differences as a percentage change relative to the baseline target, denoted "Δ mean %". These estimates are made to a precision that balances accuracy and cost control. We represent this precision as a 90.00% confidence interval denoted "Δ mean % CI": there is a 90.00% chance that the true value of "Δ mean %" is in that interval. We decide whether a change in performance is a "regression" -- a change worth investigating further -- if both of the following two criteria are true:
The table below, if present, lists those experiments that have experienced a statistically significant change in mean optimization goal performance between baseline and comparison SHAs with 90.00% confidence OR have been detected as newly erratic. Negative values of "Δ mean %" mean that baseline is faster, whereas positive values of "Δ mean %" mean that comparison is faster. Results that do not exhibit more than a ±5.00% change in their mean optimization goal are discarded. An experiment is erratic if its coefficient of variation is greater than 0.1. The abbreviated table will be omitted if no interesting change is observed. No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%. Fine details of change detection per experiment.
|
…ption to HTTP-server sources (#19141) * OPW-136 * add docs * clippy * update comments * fmt * Update src/http.rs Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com> * proptest * remove sentinel value * add upgrade guide entry * spelling --------- Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
…ption to HTTP-server sources (#19141) * OPW-136 * add docs * clippy * update comments * fmt * Update src/http.rs Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com> * proptest * remove sentinel value * add upgrade guide entry * spelling --------- Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
…ption to HTTP-server sources (#19141) * OPW-136 * add docs * clippy * update comments * fmt * Update src/http.rs Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com> * proptest * remove sentinel value * add upgrade guide entry * spelling --------- Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
…ption to HTTP-server sources (#19141) * OPW-136 * add docs * clippy * update comments * fmt * Update src/http.rs Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com> * proptest * remove sentinel value * add upgrade guide entry * spelling --------- Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
…ption to HTTP-server sources (vectordotdev#19141) * OPW-136 * add docs * clippy * update comments * fmt * Update src/http.rs Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com> * proptest * remove sentinel value * add upgrade guide entry * spelling --------- Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
Clients often use indefinitely persistent connections. Given that we recommend network-level load balancers, this can result in sub-par balancing as the worker pool grows due to a lack of rebalancing.
To resolve this, sources with a HTTP server now support a configurable option to send a
Connection: closeheader and close the connection after a certain time interval.The default max age is 5 minutes.