Skip to content

perf(sidecar)!: Batch ack sending & consumption#1835

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits intomainfrom
bob/sidecar-perf
Apr 2, 2026
Merged

perf(sidecar)!: Batch ack sending & consumption#1835
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits intomainfrom
bob/sidecar-perf

Conversation

@bwoebi
Copy link
Copy Markdown
Contributor

@bwoebi bwoebi commented Apr 1, 2026

The newly introduced acks always require an additional syscall to consume them.
Using sendmmsg()/recvmmsg() to batch it. Also only consume them when we actually need to check for limits.

Also avoid resending Start each time we access the TelemetryCachedClient. (Pure overhead)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/bob/sidecar-perf

Summary by Rule

Rule Base Branch PR Branch Change
expect_used 2 2 No change (0%)
unwrap_used 20 21 ⚠️ +1 (+5.0%)
Total 22 23 ⚠️ +1 (+4.5%)

Annotation Counts by File

File Base Branch PR Branch Change
datadog-ipc/src/platform/unix/sockets/mod.rs 0 1 ⚠️ +1 (N/A)
datadog-sidecar/src/service/blocking.rs 1 1 No change (0%)
datadog-sidecar/src/service/sidecar_server.rs 6 6 No change (0%)
datadog-sidecar/src/service/telemetry.rs 2 2 No change (0%)
libdd-telemetry/src/worker/mod.rs 13 13 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 20 21 ⚠️ +1 (+5.0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 55 55 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 8 8 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 195 196 ⚠️ +1 (+0.5%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@bwoebi bwoebi force-pushed the bob/sidecar-perf branch from 48327fc to 757bea5 Compare April 1, 2026 13:28
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 40.42553% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.60%. Comparing base (a1d45fc) to head (bca1af9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1835      +/-   ##
==========================================
+ Coverage   71.55%   71.60%   +0.04%     
==========================================
  Files         426      426              
  Lines       67155    67287     +132     
==========================================
+ Hits        48053    48181     +128     
- Misses      19102    19106       +4     
Components Coverage Δ
libdd-crashtracker 65.99% <ø> (ø)
libdd-crashtracker-ffi 34.09% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.20% <ø> (ø)
libdd-data-pipeline-ffi 72.22% <ø> (ø)
libdd-common 79.94% <ø> (ø)
libdd-common-ffi 73.87% <ø> (ø)
libdd-telemetry 62.80% <0.00%> (+0.02%) ⬆️
libdd-telemetry-ffi 16.75% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 73.10% <81.57%> (+2.79%) ⬆️
libdd-profiling 82.05% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 64.94% <ø> (ø)
datadog-sidecar 31.18% <1.68%> (-0.17%) ⬇️
datdog-sidecar-ffi 11.84% <ø> (ø)
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.24% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 88.73% <ø> (ø)
datadog-tracer-flare 86.88% <ø> (ø)
libdd-log 74.69% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented Apr 1, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 40.43%
Overall Coverage: 71.61% (+0.05%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bca1af9 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 1, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.76 MB 8.76 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 102.14 MB 102.14 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 119.15 MB 119.15 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.37 MB 11.37 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.42 MB 27.42 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 80.69 KB 80.69 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 187.85 MB 187.82 MB --.01% (-32.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 924.71 MB 924.71 MB +0% (+10 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.06 MB 9.06 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 80.69 KB 80.69 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 27.01 MB 27.01 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 61.33 MB 61.33 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.27 MB 23.27 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 81.94 KB 81.94 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 192.41 MB 192.38 MB --.01% (-32.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 909.85 MB 909.85 MB +0% (+8 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.90 MB 6.90 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 81.94 KB 81.94 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 29.12 MB 29.12 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 57.70 MB 57.70 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 88.99 MB 88.99 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.34 MB 10.34 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 111.80 MB 111.80 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 12.10 MB 12.10 MB 0% (0 B) 👌

@bwoebi bwoebi force-pushed the bob/sidecar-perf branch from ba7aea7 to f373784 Compare April 1, 2026 14:24
@bwoebi bwoebi changed the title Batch ack sending & consumption perf!(sidecar): Batch ack sending & consumption Apr 1, 2026
@bwoebi bwoebi changed the title perf!(sidecar): Batch ack sending & consumption perf(sidecar)!: Batch ack sending & consumption Apr 1, 2026
Copy link
Copy Markdown
Contributor

@Leiyks Leiyks left a comment

Choose a reason for hiding this comment

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

few things worth nothing but overall looks good 👍

Comment thread datadog-ipc-macros/src/lib.rs Outdated
#[cfg(target_os = "linux")]
{
__pending_acks += 1;
if #force_flush || __pending_acks >= 20 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be cleaner to add a constant like ACK_BUFFER_SIZE and reuse it in blocking.rs for consistency

Comment thread datadog-ipc/src/platform/unix/sockets/mod.rs
};
let mut telemetry_guard = telemetry_mutex.lock_or_panic();
let Some(telemetry) = telemetry_guard.as_mut() else {
return; // extremely rare: stopped again between the two get_or_create calls
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should add a log here even if it is rare just in case

bwoebi added 6 commits April 2, 2026 16:59
The newly introduced acks always require an additional syscall to consume them.
Using recvmmsg() to batch it. Also only consume them when we actually need to check for limits.

Also avoid resending Start each time we access the TelemetryCachedClient. (Pure overhead)

Signed-off-by: Bob Weinand <[email protected]>
Signed-off-by: Bob Weinand <[email protected]>
Signed-off-by: Bob Weinand <[email protected]>
@bwoebi bwoebi force-pushed the bob/sidecar-perf branch from 78227c5 to bca1af9 Compare April 2, 2026 14:59
@bwoebi
Copy link
Copy Markdown
Contributor Author

bwoebi commented Apr 2, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Apr 2, 2026

View all feedbacks in Devflow UI.

2026-04-02 14:59:32 UTC ℹ️ Start processing command /merge


2026-04-02 14:59:39 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-04-02 15:39:21 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 45m (p90).


2026-04-02 15:52:22 UTC ℹ️ MergeQueue: Readding this merge request to the queue because another merge request processed with yours failed. No action is needed from your side.


2026-04-02 16:32:43 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants