Skip to content

experiment(datadog metrics): build requests on global thread pool #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025

Conversation

tobz
Copy link
Member

@tobz tobz commented Jan 8, 2025

Summary

This PR updates the Datadog Metrics destination to move request building to the global thread pool, in an attempt to reduce the amount of synchronous code (Protocol Buffers encoding, compression) happening on the primary runtime.

Our hypothesis is that by doing so, we can greatly reduce the tail latency of other tasks on the primary runtime, such as socket handler tasks, and in doing so, improve the client-perceived latency of interacting with ADP.

Change Type

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

How did you test this PR?

N/A

References

N/A

@github-actions github-actions bot added area/components Sources, transforms, and destinations. destination/datadog-metrics Datadog Metrics destination. destination/datadog Common Datadog destination code. labels Jan 8, 2025
Copy link
Member Author

tobz commented Jan 8, 2025

@tobz tobz mentioned this pull request Jan 8, 2025
4 tasks
@pr-commenter
Copy link

pr-commenter bot commented Jan 8, 2025

Regression Detector (DogStatsD)

Regression Detector Results

Run ID: adcd4def-37f4-487e-a96b-a42d525d06b0

Baseline: 7.65.0-rc.9
Comparison: 7.65.0-rc.9

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_100mb_3k_contexts_distributions_only memory utilization +0.50 [+0.29, +0.70] 1
dsd_uds_100mb_3k_contexts ingress throughput +0.01 [-0.09, +0.11] 1
dsd_uds_100mb_250k_contexts ingress throughput +0.00 [-0.10, +0.10] 1
dsd_uds_40mb_12k_contexts_40_senders ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts_memlimit ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_512kb_3k_contexts ingress throughput -0.00 [-0.01, +0.01] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_10mb_3k_contexts ingress throughput -0.00 [-0.03, +0.03] 1
quality_gates_idle_rss memory utilization -1.60 [-1.74, -1.46] 1
dsd_uds_500mb_3k_contexts ingress throughput -3.05 [-3.12, -2.97] 1

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 0/10

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".

@pr-commenter
Copy link

pr-commenter bot commented Jan 8, 2025

Regression Detector (Saluki)

Regression Detector Results

Run ID: c04b27c5-c65c-4b3b-9569-8e860186c9b8

Baseline: bd6799f
Comparison: c67420e
Diff

Optimization Goals: ✅ Improvement(s) detected

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_1mb_50k_contexts_memlimit ingress throughput +17.62 [+15.95, +19.28] 1
quality_gates_idle_rss memory utilization -5.51 [-5.65, -5.37] 1

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_1mb_50k_contexts_memlimit ingress throughput +17.62 [+15.95, +19.28] 1
dsd_uds_500mb_3k_contexts ingress throughput +1.80 [+1.68, +1.92] 1
dsd_uds_100mb_250k_contexts ingress throughput +0.01 [-0.07, +0.09] 1
dsd_uds_50mb_10k_contexts_no_inlining ingress throughput +0.01 [-0.10, +0.11] 1
dsd_uds_1mb_50k_contexts ingress throughput +0.00 [-0.00, +0.01] 1
dsd_uds_50mb_10k_contexts_no_inlining_no_allocs ingress throughput +0.00 [-0.09, +0.10] 1
dsd_uds_40mb_12k_contexts_40_senders ingress throughput +0.00 [-0.03, +0.03] 1
dsd_uds_512kb_3k_contexts ingress throughput -0.00 [-0.01, +0.01] 1
dsd_uds_100mb_3k_contexts ingress throughput -0.00 [-0.06, +0.06] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.02, +0.01] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput -0.01 [-0.02, +0.01] 1
dsd_uds_10mb_3k_contexts ingress throughput -0.02 [-0.05, +0.01] 1
dsd_uds_100mb_3k_contexts_distributions_only memory utilization -3.67 [-3.83, -3.51] 1
quality_gates_idle_rss memory utilization -5.51 [-5.65, -5.37] 1

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 10/10

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".

@pr-commenter
Copy link

pr-commenter bot commented Jan 8, 2025

Regression Detector Links

Experiment Result Links

experiment link(s)
dsd_uds_100mb_250k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts_distributions_only [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_10mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts_dualship [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts_memlimit [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_40mb_12k_contexts_40_senders [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_500mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_512kb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
quality_gates_idle_rss [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining (ADP only) [Profiling (ADP)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining_no_allocs (ADP only) [Profiling (ADP)] [SMP Dashboard]

@tobz tobz force-pushed the tobz/generic-async-thread-pool branch 2 times, most recently from bfd9cb4 to 9d1396e Compare April 16, 2025 18:55
@tobz tobz force-pushed the tobz/dd-metrics-request-builder-thread-poolified branch from fb1c72e to c67420e Compare April 16, 2025 19:49
@github-actions github-actions bot added the area/core Core functionality, event model, etc. label Apr 16, 2025
@tobz tobz changed the title experiment: try building requests for DD metrics destination on thread pool experiment(datadog metrics): build requests on global thread pool Apr 16, 2025
Copy link
Contributor

@rayz rayz left a comment

Choose a reason for hiding this comment

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

lgtm

@tobz tobz marked this pull request as ready for review April 17, 2025 19:02
@tobz tobz requested a review from a team as a code owner April 17, 2025 19:02
Copy link
Member Author

tobz commented Apr 17, 2025

Merge activity

  • Apr 17, 3:30 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 17, 3:35 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 17, 3:37 PM EDT: A user merged this pull request with Graphite.

@tobz tobz changed the base branch from tobz/generic-async-thread-pool to graphite-base/413 April 17, 2025 19:31
@tobz tobz changed the base branch from graphite-base/413 to main April 17, 2025 19:34
@tobz tobz force-pushed the tobz/dd-metrics-request-builder-thread-poolified branch from 4c0a340 to 0909e87 Compare April 17, 2025 19:35
@tobz tobz merged commit 8e7b0ff into main Apr 17, 2025
14 of 31 checks passed
@tobz tobz deleted the tobz/dd-metrics-request-builder-thread-poolified branch April 17, 2025 19:38
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/core Core functionality, event model, etc. destination/datadog Common Datadog destination code. destination/datadog-metrics Datadog Metrics destination.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants