Skip to content

Comments

enhancement(io): rework how framing interacts with I/O buffers#983

Draft
tobz wants to merge 1 commit intomainfrom
tobz/reworked-io-buffers
Draft

enhancement(io): rework how framing interacts with I/O buffers#983
tobz wants to merge 1 commit intomainfrom
tobz/reworked-io-buffers

Conversation

@tobz
Copy link
Member

@tobz tobz commented Oct 30, 2025

Summary

Work in progress.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

References

@github-actions github-actions bot added area/io General I/O and networking. area/components Sources, transforms, and destinations. source/dogstatsd DogStatsD source. labels Oct 30, 2025
@pr-commenter
Copy link

pr-commenter bot commented Oct 30, 2025

Regression Detector (Agent Data Plane)

Regression Detector Results

Run ID: a22c8a00-c443-4b6e-8215-6ceb2a42006d

Baseline: 2b02146
Comparison: cf6bd87
Diff

❌ Experiments with retried target crashes

This is a critical error. One or more replicates failed with a non-zero exit code. These replicates may have been retried. See Replicate Execution Details for more information.

  • otlp_ingest_traces_5mb_cpu
  • quality_gates_rss_dsd_low
  • quality_gates_rss_dsd_ultraheavy
  • otlp_ingest_metrics_5mb_throughput

Optimization Goals: ✅ Improvement(s) detected

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_500mb_3k_contexts_throughput ingress throughput +8.83 [+8.70, +8.96] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_cpu % cpu utilization -6.90 [-12.79, -1.01] 1 (metrics) (profiles) (logs)

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
otlp_ingest_logs_5mb_memory memory utilization +8.48 [+7.96, +9.00] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.02 [-0.14, +0.11] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization -0.16 [-5.46, +5.13] 1 (metrics) (profiles) (logs)

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_500mb_3k_contexts_throughput ingress throughput +8.83 [+8.70, +8.96] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_memory memory utilization +8.48 [+7.96, +9.00] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_cpu % cpu utilization +6.15 [-49.32, +61.62] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_memory memory utilization +3.56 [+3.33, +3.80] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_cpu % cpu utilization +3.43 [+1.24, +5.62] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_cpu % cpu utilization +2.74 [-3.24, +8.73] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_memory memory utilization +1.21 [+1.02, +1.40] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory utilization +0.74 [+0.57, +0.90] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_memory memory utilization +0.55 [+0.36, +0.73] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_memory memory utilization +0.19 [-0.01, +0.39] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_heavy memory utilization +0.16 [+0.03, +0.28] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_memory memory utilization +0.03 [-0.15, +0.21] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_throughput ingress throughput +0.02 [-0.03, +0.08] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_throughput ingress throughput +0.01 [-0.15, +0.16] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_throughput ingress throughput -0.00 [-0.02, +0.02] 1 (metrics) (profiles) (logs)
dsd_uds_1mb_3k_contexts_throughput ingress throughput -0.00 [-0.06, +0.05] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_throughput ingress throughput -0.00 [-0.06, +0.05] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_throughput ingress throughput -0.02 [-0.14, +0.11] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory utilization -0.02 [-0.21, +0.16] 1 (metrics) (profiles) (logs)
otlp_ingest_metrics_5mb_throughput ingress throughput -0.04 [-0.17, +0.09] 1 (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory utilization -0.13 [-0.27, +0.01] 1 (metrics) (profiles) (logs)
quality_gates_rss_idle memory utilization -0.13 [-0.18, -0.08] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_memory memory utilization -0.14 [-0.34, +0.06] 1 (metrics) (profiles) (logs)
otlp_ingest_logs_5mb_cpu % cpu utilization -0.16 [-5.46, +5.13] 1 (metrics) (profiles) (logs)
otlp_ingest_traces_5mb_memory memory utilization -0.45 [-0.73, -0.16] 1 (metrics) (profiles) (logs)
dsd_uds_500mb_3k_contexts_cpu % cpu utilization -0.61 [-1.94, +0.73] 1 (metrics) (profiles) (logs)
dsd_uds_512kb_3k_contexts_cpu % cpu utilization -3.43 [-58.63, +51.77] 1 (metrics) (profiles) (logs)
dsd_uds_10mb_3k_contexts_cpu % cpu utilization -6.35 [-36.11, +23.41] 1 (metrics) (profiles) (logs)
dsd_uds_100mb_3k_contexts_cpu % cpu utilization -6.90 [-12.79, -1.01] 1 (metrics) (profiles) (logs)

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
quality_gates_rss_dsd_heavy memory_usage 10/10 (metrics) (profiles) (logs)
quality_gates_rss_dsd_low memory_usage 10/10 (metrics) (profiles) (logs)
quality_gates_rss_dsd_medium memory_usage 10/10 (metrics) (profiles) (logs)
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 (metrics) (profiles) (logs)
quality_gates_rss_idle memory_usage 10/10 (metrics) (profiles) (logs)

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Replicate Execution Details

We run multiple replicates for each experiment/variant. However, we allow replicates to be automatically retried if there are any failures, up to 8 times, at which point the replicate is marked dead and we are unable to run analysis for the entire experiment. We call each of these attempts at running replicates a replicate execution. This section lists all replicate executions that failed due to the target crashing or being oom killed.

Note: In the below tables we bucket failures by experiment, variant, and failure type. For each of these buckets we list out the replicate indexes that failed with an annotation signifying how many times said replicate failed with the given failure mode. In the below example the baseline variant of the experiment named experiment_with_failures had two replicates that failed by oom kills. Replicate 0, which failed 8 executions, and replicate 1 which failed 6 executions, all with the same failure mode.

Experiment Variant Replicates Failure Logs Debug Dashboard
experiment_with_failures baseline 0 (x8) 1 (x6) Oom killed Debug Dashboard

The debug dashboard links will take you to a debugging dashboard specifically designed to investigate replicate execution failures.

❌ Retried Normal Replicate Execution Failures (non-profiling)

Experiment Variant Replicates Failure Debug Dashboard
otlp_ingest_metrics_5mb_throughput comparison 8 Failed to shutdown when requested Debug Dashboard
otlp_ingest_traces_5mb_cpu comparison 9 Failed to shutdown when requested Debug Dashboard
quality_gates_rss_dsd_low comparison 6 Failed to shutdown when requested Debug Dashboard
quality_gates_rss_dsd_ultraheavy comparison 7 Failed to shutdown when requested Debug Dashboard

@tobz tobz force-pushed the tobz/reworked-io-buffers branch from 5d9fb67 to 1410ea6 Compare October 31, 2025 12:55
Copy link
Contributor

@lukesteensen lukesteensen left a comment

Choose a reason for hiding this comment

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

I can't say I've really internalized how it works, but I think I get it and it seems reasonable 😅

Comment on lines 159 to 161
// Figure out how far the buffer view has been advanced and advance the underlying buffer
// by that many bytes, which keeps things consistent.
let advance_by = self.0.borrow_buf().remaining() - self.0.borrow_iter().buf_len();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the remaining call here match with the use of chunk above? Seems like it could be wrong for non-contiguous buffers. It could be simpler to just keep track of how much we consume directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right on both fronts.

We never use non-contiguous buffers on the ingest side (BytesBuffer) so our usage of Buf here is somewhat loose here: this should be correct, but may not always be.

We could tie to more directly to BytesBuffer and revisit this generic approach later on if necessary, or we could do the bit you mentioned about tracking it directly... but I'm not sure I grok what you're envisioning there. Could you give a little more detail on that idea?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, just realized I had a diff for this and totally forgot to respond 😞

Pushed to a branch here, feel free to take it or leave it. Claude added some tests and things you may or may not care about.

@tobz tobz force-pushed the tobz/reworked-io-buffers branch from 1410ea6 to 8b75c42 Compare November 4, 2025 14:30
Copy link
Member Author

tobz commented Nov 4, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the area/docs Reference documentation. label Nov 4, 2025
@tobz tobz force-pushed the tobz/reworked-io-buffers branch from 9bdc522 to 3af664a Compare December 28, 2025 18:27
@pr-commenter
Copy link

pr-commenter bot commented Dec 28, 2025

Binary Size Analysis (Agent Data Plane)

Target: 2b02146 (baseline) vs cf6bd87 (comparison) diff
Analysis Type: Stripped binaries (debug symbols excluded)
Baseline Size: 26.87 MiB
Comparison Size: 26.86 MiB
Size Change: -10.45 KiB (-0.04%)
Pass/Fail Threshold: +5%
Result: PASSED ✅

Changes by Module

Module File Size Symbols
saluki_components::sources::dogstatsd -8.61 KiB 6
saluki_io::deser::framing -2.95 KiB 20
[Unmapped] +2.71 KiB 1
bytes -1.52 KiB 7
core +1.04 KiB 38
hyper_rustls -505 B 2
saluki_io::buf::vec -192 B 1
[sections] -189 B 7
saluki_common::task::instrument -146 B 2
h2 +90 B 7
hyper -81 B 2
saluki_components::common::datadog -60 B 1
saluki_io::net::client -60 B 1
unicode_segmentation -48 B 1
hickory_proto +43 B 11
__finalized.1738 -24 B 1
tokio +14 B 32
saluki_components::sources::otlp +5 B 1
std -4 B 15
agent_data_plane::internal::remote_agent -3 B 1

Detailed Symbol Changes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +17.6Ki  [NEW] +17.5Ki    _<saluki_common::task::instrument::InstrumentedTask<F> as core::future::future::Future>::poll::h667ef4daee0ab193
  [NEW] +9.34Ki  [NEW] +9.15Ki    _<saluki_components::sources::dogstatsd::DogStatsD as saluki_core::components::sources::Source>::run::_{{closure}}::h03e2f754767dbe2e
  [NEW] +5.13Ki  [NEW] +5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11464
  [NEW] +4.71Ki  [NEW] +4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11429
  [NEW] +3.83Ki  [NEW] +3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11626
  [NEW] +3.57Ki  [NEW] +3.45Ki    <rustls::error::Error as core::fmt::Debug>::fmt.11430
   +93% +2.71Ki  [ = ]       0    [Unmapped]
  [NEW] +1.79Ki  [NEW] +1.65Ki    <tonic::transport::channel::endpoint::Endpoint as core::clone::Clone>::clone.13194
  [NEW] +1.57Ki  [NEW] +1.50Ki    tokio::runtime::task::raw::poll::h8ae0139d00aaf8e1
  [NEW] +1.54Ki  [NEW] +1.46Ki    tokio::runtime::task::raw::poll::h141b155b261cedb3
  [DEL] -1.54Ki  [DEL] -1.46Ki    tokio::runtime::task::raw::poll::ha188c6dffca733f0
  [DEL] -1.57Ki  [DEL] -1.50Ki    tokio::runtime::task::raw::poll::h216e0a17c8efef6a
  [DEL] -1.79Ki  [DEL] -1.65Ki    <tonic::transport::channel::endpoint::Endpoint as core::clone::Clone>::clone.13208
  [DEL] -3.57Ki  [DEL] -3.45Ki    <rustls::error::Error as core::fmt::Debug>::fmt.11444
  [DEL] -3.83Ki  [DEL] -3.71Ki    <webpki::error::Error as core::fmt::Debug>::fmt.11640
  -0.3% -4.38Ki  -0.2% -2.05Ki    [229 Others]
  [DEL] -4.71Ki  [DEL] -4.59Ki    <rustls::error::Error as core::clone::Clone>::clone.11443
  [DEL] -5.13Ki  [DEL] -5.00Ki    <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11478
 -26.5% -8.71Ki -26.6% -8.71Ki    saluki_components::sources::dogstatsd::drive_stream::_{{closure}}::h7a0b9c0eda95cb0d
  [DEL] -9.28Ki  [DEL] -9.09Ki    _<saluki_components::sources::dogstatsd::DogStatsD as saluki_core::components::sources::Source>::run::_{{closure}}::h7acbbb6388dcee1a
  [DEL] -17.8Ki  [DEL] -17.6Ki    _<saluki_common::task::instrument::InstrumentedTask<F> as core::future::future::Future>::poll::he2ecef1bad274487
  -0.0% -10.5Ki  -0.0% -10.8Ki    TOTAL

@tobz tobz force-pushed the tobz/reworked-io-buffers branch from 0ed1380 to 2da0414 Compare January 28, 2026 02:00
@tobz tobz force-pushed the tobz/reworked-io-buffers branch from 76ba3fa to cf6bd87 Compare February 19, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. area/docs Reference documentation. area/io General I/O and networking. source/dogstatsd DogStatsD source.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants