Skip to content

add switch for setting round trip time to connection info - #28159

Merged
yanavlasov merged 6 commits into
envoyproxy:mainfrom
wbpcode:dev-disable-ttl-setting
Jul 18, 2023
Merged

yanavlasov merged 6 commits into
envoyproxy:mainfrom
wbpcode:dev-disable-ttl-setting

Conversation

@wbpcode

@wbpcode wbpcode commented Jun 27, 2023

Copy link
Copy Markdown
Member

Commit Message: add switch for setting round trip time to stream info
Additional Description:

To close #28133

Risk Level: low.
Testing: n/a.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #28159 was opened by wbpcode.

see: more, trace.

@wbpcode wbpcode assigned lizan and unassigned markdroth Jun 27, 2023

@ggreenway ggreenway left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/wait-any

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RTT isn't currently used for anything externally. I'm guessing the original author had an internal use for this. Should this have a code-level opt-in instead of a config knob? For open-source Envoy, this doesn't do anything useful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what you mean by code-level opt-in? A runtime guard that default to false? Both ok for me, I just think most users shouldn't pay the overhead for they needn't, esp the overhead is non-trivial. Even we can remove it directly if no one need it for now.

cc @DiazAlan could you take a look when you have free time, thanks?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that instead of a config knob, there be a function on the hcm (or somewhere) that code could call to enable this feature: void enableRttIntoConnection(bool enable) or something.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then users want this feature need call this method by rebuilding envoy or call this method in their fork?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, I think we can disable this feature by runtime flag first. And the one who wants the feature could complain if they want better way.

@botengyao botengyao Jun 30, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this can be added to substitution_formatter as well

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a similar request for it #27391, maybe we should enable the access log to access the stats directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a similar request for it #27391, maybe we should enable the access log to access the stats directly.

And indeed we collect the tcp_rtt at

config_->stats_.cx_rtt_us_.recordValue(tcp_info->tcpi_rtt);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR was opened to disable per-request rtt refreshment to avoid high CPU overhead. Not about how to expose the rtt to end users 🤣

@soulxu soulxu Jul 3, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, actually, that is what I want to say here. Sorry, I didn't describe it clearly.

I mean we can enable access log to get the stats directly, like enable something like %STATS(stat_name)%. (I think I'm talking about the same thing with @botengyao), then first, we fulfill those two persons' requirements. (But yes, the first thing is whether we think this use-case is useful or not. At least, this was requested by two different people.)

And then, the rtt refreshment can be done by the tcp_stats ext. Then the user can disable it by disabling tcp_stats ext if they needn't it. This reaches the goal: the CPU overhead which is introduced by rtt refreshment won't add to every user even if they needn't it.

Then this seems a more generic solution for this requirement, and it isn't a feature enabled all the time and introduced CPU overhead all the time.

@wbpcode

wbpcode commented Jun 30, 2023

Copy link
Copy Markdown
Member Author

/wait for conclusion from offline disscussion.

@wbpcode wbpcode changed the title add switch for setting round trip time to stream info add switch for setting round trip time to connection info Jul 4, 2023
@wbpcode
wbpcode force-pushed the dev-disable-ttl-setting branch from 797a73d to b8cb225 Compare July 4, 2023 09:20
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #28159 was synchronize by wbpcode.

see: more, trace.

@wbpcode wbpcode removed the api label Jul 6, 2023
wbpcode added 3 commits July 6, 2023 02:02
Signed-off-by: wbpcode <[email protected]>
Signed-off-by: wbpcode <[email protected]>
@ggreenway ggreenway assigned jmarantz and yanavlasov and unassigned ggreenway Jul 6, 2023
@jmarantz

jmarantz commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

Can this wait till Yan is back to discuss?

@wbpcode

wbpcode commented Jul 7, 2023

Copy link
Copy Markdown
Member Author

I think yan has approved this way at the offline discussion. But I am ok to wait yan back.
(in fact, i am out in next week, so, it is completely ok)

@jmarantz

jmarantz commented Jul 7, 2023

Copy link
Copy Markdown
Contributor

/wait (for Yan)

@wbpcode

wbpcode commented Jul 13, 2023

Copy link
Copy Markdown
Member Author

friendly ping @yanavlasov for a review

@yanavlasov
yanavlasov merged commit 6496a0e into envoyproxy:main Jul 18, 2023
michaelfinch added a commit to michaelfinch/envoy that referenced this pull request Jul 19, 2023
* main: (46 commits)
  buffer: Disable second flaky test on windows. (envoyproxy#28483)
  ci/github: Fix repo contexts (envoyproxy#28482)
  ci/github: Minor fix for untrusted code (envoyproxy#28480)
  ci/github: Fixes/cleanups for env and workflows (envoyproxy#28473)
  examples: Warn on `golang-network` flake (envoyproxy#28478)
  build(deps): bump node from 20.3-bullseye-slim to 20.4-bullseye-slim in /examples/shared/node (envoyproxy#28321)
  ecds: add network filter dynamic config provider (envoyproxy#28407)
  deps: bump gRPC to 1.56.2 (envoyproxy#28449)
  Adding disallowed_headers in the ext_proc header forwarding rule. (envoyproxy#28468)
  golang filter: add VirtualClusterName getter (envoyproxy#28406)
  ci/github: Further fixes/cleanups for verify (envoyproxy#28467)
  coverage: Lower `source/common/quic` to fix permafail (93.3) (envoyproxy#28471)
  deps: Bump `rules_python` -> 0.24.0 (envoyproxy#28347)
  ci/github: Fix/improve CI env (envoyproxy#28465)
  improve header matcher output (envoyproxy#28389)
  grpc-patch: fix for oss-fuzz build (envoyproxy#28409)
  ext_proc: Refactor startStream logic and fix crash issue (envoyproxy#28424)
  add switch for setting round trip time to connection info (envoyproxy#28159)
  accesslog: disable resource labels (envoyproxy#28046)
  Remove unused header (envoyproxy#28447)
  ...
@wbpcode
wbpcode deleted the dev-disable-ttl-setting branch June 6, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http: round-trip recording in stream info adds 2% CPU overhead in a benchmark

8 participants