Skip to content

Cap protocol classification attempts per connection - #376

Open
LouisParkin wants to merge 6 commits into
masterfrom
classification-attempt-cap
Open

LouisParkin wants to merge 6 commits into
masterfrom
classification-attempt-cap

Conversation

@LouisParkin

@LouisParkin LouisParkin commented Oct 27, 2026 •

Copy link
Copy Markdown

Fixes #354

This bumps the fork to StackVista/datadog-agent-upstream-for-process-agent#854, which stops classifying a connection whose protocol is never recognised once it has used its budget of data segments. In the local reproduction with 3000 busy connections, this image raised throughput from 26.6 to 32.6 Gbps (42.3 Gbps with the agent off).

Two new environment variables override the budgets. If unset or out of range, the eBPF defaults apply:

  • STS_PROTOCOL_CLASSIFICATION_HANDSHAKE_MAX_SEGMENTS
  • STS_PROTOCOL_CLASSIFICATION_MID_STREAM_MAX_SEGMENTS

The fork replace temporarily points at StackVista/datadog-agent-upstream-for-process-agent#855 (f82aa1c5, includes the merged cap), which fixes the unrelated csaf module breakage (#381). It will be repointed at stackstate-7.62.2 once that merges.

Pulls in the fork change that stops USM classification of connections
whose protocol is never recognised once they use their budget of
attempts, which removed most of the throughput loss on dense nodes.

STS_PROTOCOL_CLASSIFICATION_HANDSHAKE_BUDGET and
STS_PROTOCOL_CLASSIFICATION_MID_STREAM_BUDGET override the budgets for
connections with and without an observed handshake; unset or out of
range keeps the eBPF defaults.

Fixes #354

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread config/config.go Outdated
DisabledProtocols []string
// Packet inspections allowed on a connection with an unrecognised protocol, with and without an observed
// handshake. Zero selects the eBPF default.
ClassificationHandshakeBudget uint16

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does 'Budget' mean? I think this should have some kind of unit in the name to understand what the budget means

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Renamed to ClassificationHandshakeMaxSegments / ClassificationMidStreamMaxSegments, env vars STS_PROTOCOL_CLASSIFICATION_{HANDSHAKE,MID_STREAM}_MAX_SEGMENTS, in 5f32d1e. The budget now counts data segments, each counted once across hooks.

LouisParkin and others added 2 commits October 28, 2026 14:04
Renames the budget settings and env vars to *_MAX_SEGMENTS so the unit
is explicit, matching the fork's per-segment accounting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Picks up the review fixes in datadog-agent-upstream-for-process-agent#854:
USM shares the tracer's budget map, segments are counted once, and
entries are removed on tcp_close.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Picks up the retry-budget fix from
StackVista/datadog-agent-upstream-for-process-agent#854.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
StackVista/datadog-agent-upstream-for-process-agent#854 is merged as
c5edc213.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The old module path no longer resolves (a new, tagless repo now sits at
it), which fails go mod download in CI. Replaces do not propagate from
dependencies, so this mirrors the fork's replace, and temporarily points
the fork at the replace-csaf-poc branch until that PR merges.

Refs #381

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate process-agent throughput degradation on high-density Kubernetes nodes

2 participants