datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

[ASCII-2415] Add CPU profiles for each agent process and use PGO

Open pgimalac opened this issue 1 year ago • 3 comments

What does this PR do?

Add profiles for each process (core, trace, process, security, system-probe) and use them to build the agent with PGO.

Motivation

Investigate the impact of PGO on agent resource usage and performance.

Describe how to test/QA your changes

Possible Drawbacks / Trade-offs

Additional Notes

Created a PR to ease visualizing SMP results, this should not be merged.

I checked locally that the compiler uses the provided profiles (they are used implicitly so it doesn't appear in the commands, but when running go build -x ... it shows that they're used).

pgimalac avatar Oct 21 '24 12:10 pgimalac

[Fast Unit Tests Report]

On pipeline 47039614 (CI Visibility). The following jobs did not run any unit tests:

Jobs:
  • tests_deb-arm64-py3
  • tests_deb-x64-py3
  • tests_flavor_dogstatsd_deb-x64
  • tests_flavor_heroku_deb-x64
  • tests_flavor_iot_deb-x64
  • tests_rpm-arm64-py3
  • tests_rpm-x64-py3
  • tests_windows-x64

If you modified Go files and expected unit tests to run in these jobs, please double check the job logs. If you think tests should have been executed reach out to #agent-devx-help

Regression Detector

Regression Detector Results

Run ID: 8f456cb2-dbe6-4222-8ce3-4eab666e5230 Metrics dashboard Target profiles

Baseline: b9db97adc910e802e8cc6704d768652c4f80bc06 Comparison: 110b85863c5aa4c6e921ee69e170493bb06aa334

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

Significant changes in experiment optimization goals

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

perf experiment goal Δ mean % Δ mean % CI trials links
tcp_syslog_to_blackhole ingress throughput -10.60 [-10.66, -10.54] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
uds_dogstatsd_to_api_cpu % cpu utilization +1.06 [+0.30, +1.83] 1 Logs
idle memory utilization +0.54 [+0.50, +0.59] 1 Logs
pycheck_lots_of_tags % cpu utilization +0.49 [-2.21, +3.20] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.03, +0.02] 1 Logs
otel_to_otel_logs ingress throughput -0.59 [-1.42, +0.24] 1 Logs
file_tree memory utilization -0.77 [-0.89, -0.65] 1 Logs
basic_py_check % cpu utilization -1.20 [-4.06, +1.66] 1 Logs
tcp_syslog_to_blackhole ingress throughput -10.60 [-10.66, -10.54] 1 Logs

Bounds Checks

perf experiment bounds_check_name replicates_passed
idle memory_usage 10/10

Explanation

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[bot] avatar Oct 21 '24 14:10 pr-commenter[bot]

Regression Detector Results

Run ID: 1b3cf28a-7a12-4abf-a5de-0c0d18a22d1b Metrics dashboard Target profiles

Baseline: 7.58.0 Comparison: 7-58-1-beta-pgo-prod-profiles-py3

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

Significant changes in experiment optimization goals

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

perf experiment goal Δ mean % Δ mean % CI trials links
tcp_syslog_to_blackhole ingress throughput -10.70 [-10.73, -10.68] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
idle_all_features memory utilization +0.40 [+0.36, +0.43] 1 Logs bounds checks dashboard
file_tree memory utilization +0.38 [+0.34, +0.43] 1 Logs
idle memory utilization +0.37 [+0.35, +0.39] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization +0.29 [+0.26, +0.33] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization +0.02 [+0.00, +0.05] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency egress throughput +0.02 [-0.20, +0.24] 1 Logs
file_to_blackhole_300ms_latency egress throughput +0.02 [-0.06, +0.10] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.01 [-0.10, +0.12] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.00 [-0.15, +0.15] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.00, +0.00] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.05, +0.03] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.01 [-0.11, +0.09] 1 Logs
otel_to_otel_logs ingress throughput -0.38 [-0.74, -0.02] 1 Logs
pycheck_lots_of_tags % cpu utilization -0.50 [-1.60, +0.59] 1 Logs
basic_py_check % cpu utilization -0.79 [-1.98, +0.39] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization -1.09 [-1.41, -0.77] 1 Logs
tcp_syslog_to_blackhole ingress throughput -10.70 [-10.73, -10.68] 1 Logs

Bounds Checks

perf experiment bounds_check_name replicates_passed
idle memory_usage 25/50
quality_gate_idle memory_usage 31/50
file_to_blackhole_0ms_latency memory_usage 50/50
file_to_blackhole_1000ms_latency memory_usage 50/50
file_to_blackhole_100ms_latency memory_usage 50/50
file_to_blackhole_300ms_latency memory_usage 50/50
file_to_blackhole_500ms_latency memory_usage 50/50
idle_all_features memory_usage 50/50
quality_gate_idle_all_features memory_usage 50/50

Explanation

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

pgimalac avatar Oct 23 '24 11:10 pgimalac