Skip to content

[Serverless-Init] Use zstd compression#41353

Merged
dd-mergequeue[bot] merged 2 commits into
mainfrom
nicholas.hulston/serverless-init-use-zstd
Sep 29, 2025
Merged

[Serverless-Init] Use zstd compression#41353
dd-mergequeue[bot] merged 2 commits into
mainfrom
nicholas.hulston/serverless-init-use-zstd

Conversation

@nhulston

@nhulston nhulston commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Use zstd compression. We just need to enable add the zstd build tag (in DataDog/datadog-lambda-extension#878)

Before this change:
Screenshot 2025-09-29 at 12 45 16 PM

After this change:
Screenshot 2025-09-29 at 12 45 24 PM

The cum% for (*batchStrategy).addMessage goes down from 20.16% to 4.12%.

Screenshot 2025-09-29 at 5 13 42 PM

For more information, see this one-pager.

This PR pretty much just reverts #37523

Motivation

Improving serverless-init performance
https://datadoghq.atlassian.net/browse/SVLS-7667

Describe how you validated your changes

Additional Notes

@cit-pr-commenter

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: cb33813e-bc70-41b2-a4db-9eaece2d1091

Baseline: 2c3e2c9
Comparison: b0137e0
Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

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

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization -1.27 [-4.42, +1.87] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +4.84 [+1.93, +7.74] 1 Logs bounds checks dashboard
otlp_ingest_logs memory utilization +0.86 [+0.74, +0.98] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.84 [+0.77, +0.91] 1 Logs
quality_gate_metrics_logs memory utilization +0.77 [+0.57, +0.98] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization +0.63 [+0.59, +0.66] 1 Logs bounds checks dashboard
ddot_metrics_sum_cumulativetodelta_exporter memory utilization +0.32 [+0.13, +0.52] 1 Logs
file_tree memory utilization +0.07 [+0.02, +0.12] 1 Logs
docker_containers_memory memory utilization +0.06 [-0.10, +0.21] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.05 [-0.51, +0.61] 1 Logs
otlp_ingest_metrics memory utilization +0.02 [-0.11, +0.14] 1 Logs
ddot_logs memory utilization +0.02 [-0.04, +0.07] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.01 [-0.53, +0.55] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.22, +0.20] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.02 [-0.66, +0.62] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.04 [-0.64, +0.56] 1 Logs
ddot_metrics_sum_cumulative memory utilization -0.07 [-0.19, +0.05] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization -0.10 [-0.14, -0.05] 1 Logs
quality_gate_idle_all_features memory utilization -0.31 [-0.35, -0.28] 1 Logs bounds checks dashboard
ddot_metrics memory utilization -0.32 [-0.49, -0.16] 1 Logs
ddot_metrics_sum_delta memory utilization -0.45 [-0.60, -0.29] 1 Logs
docker_containers_cpu % cpu utilization -1.27 [-4.42, +1.87] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 bounds checks dashboard

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

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@agent-platform-auto-pr

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 2c3e2c9

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${-0}$$ $${697.14}$$ < $${703.13}$$ $${+0.04}$$ $${175.49}$$ < $${178.38}$$
agent_deb_amd64_fips $${-0}$$ $${691.64}$$ < $${697.61}$$ $${+0.01}$$ $${174.03}$$ < $${177.15}$$
agent_heroku_amd64 $${0}$$ $${335.92}$$ < $${341.62}$$ $${-0}$$ $${88.94}$$ < $${91.52}$$
agent_msi $${0}$$ $${988.69}$$ < $${990.42}$$ $${-0.01}$$ $${150.86}$$ < $${152.42}$$
agent_rpm_amd64 $${-0}$$ $${697.13}$$ < $${703.12}$$ $${-0.02}$$ $${177.76}$$ < $${180.53}$$
agent_rpm_amd64_fips $${-0}$$ $${691.63}$$ < $${697.6}$$ $${+0.01}$$ $${176.17}$$ < $${178.87}$$
agent_rpm_arm64 $${+0}$$ $${683.25}$$ < $${689.82}$$ $${-0.03}$$ $${159.03}$$ < $${162.16}$$
agent_rpm_arm64_fips $${+0}$$ $${678.77}$$ < $${685.08}$$ $${-0.04}$$ $${157.91}$$ < $${161.11}$$
agent_suse_amd64 $${-0}$$ $${697.13}$$ < $${703.12}$$ $${-0.02}$$ $${177.76}$$ < $${180.53}$$
agent_suse_amd64_fips $${-0}$$ $${691.63}$$ < $${697.6}$$ $${+0.01}$$ $${176.17}$$ < $${178.87}$$
agent_suse_arm64 $${+0}$$ $${683.25}$$ < $${689.82}$$ $${-0.03}$$ $${159.03}$$ < $${162.16}$$
agent_suse_arm64_fips $${+0}$$ $${678.77}$$ < $${685.08}$$ $${-0.04}$$ $${157.91}$$ < $${161.11}$$
docker_agent_amd64 $${-0}$$ $${768.51}$$ < $${774.54}$$ $${+0}$$ $${263.2}$$ < $${266.46}$$
docker_agent_arm64 $${+0}$$ $${778.58}$$ < $${785.2}$$ $${-0}$$ $${249.27}$$ < $${252.92}$$
docker_agent_jmx_amd64 $${-0}$$ $${959.38}$$ < $${965.41}$$ $${-0}$$ $${331.83}$$ < $${335.08}$$
docker_agent_jmx_arm64 $${+0}$$ $${958.05}$$ < $${964.66}$$ $${+0}$$ $${313.88}$$ < $${317.54}$$
docker_cluster_agent_amd64 $${-0}$$ $${212.86}$$ < $${213.74}$$ $${+0}$$ $${72.22}$$ < $${73.2}$$
docker_cluster_agent_arm64 $${-0}$$ $${228.8}$$ < $${229.68}$$ $${+0}$$ $${68.48}$$ < $${69.48}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.06}$$ < $${7.12}$$ $${-0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${0}$$ $${38.39}$$ < $${39.3}$$ $${+0}$$ $${14.83}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${0}$$ $${37.05}$$ < $${37.94}$$ $${-0}$$ $${14.28}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${29.63}$$ < $${30.53}$$ $${+0}$$ $${7.82}$$ < $${8.75}$$
dogstatsd_deb_arm64 $${0}$$ $${28.21}$$ < $${29.12}$$ $${-0}$$ $${6.77}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${29.63}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.77}$$
dogstatsd_suse_amd64 $${0}$$ $${29.63}$$ < $${30.53}$$ $${-0}$$ $${7.83}$$ < $${8.77}$$
iot_agent_deb_amd64 $${0}$$ $${54.57}$$ < $${54.97}$$ $${-0}$$ $${13.64}$$ < $${14.45}$$
iot_agent_deb_arm64 $${0}$$ $${51.85}$$ < $${51.9}$$ $${-0}$$ $${11.76}$$ < $${12.63}$$
iot_agent_deb_armhf $${0}$$ $${51.39}$$ < $${51.84}$$ $${-0}$$ $${11.84}$$ < $${12.74}$$
iot_agent_rpm_amd64 $${0}$$ $${54.57}$$ < $${54.97}$$ $${-0}$$ $${13.66}$$ < $${14.47}$$
iot_agent_suse_amd64 $${0}$$ $${54.57}$$ < $${54.97}$$ $${-0}$$ $${13.66}$$ < $${14.47}$$

@nhulston nhulston added the qa/done QA done before merge and regressions are covered by tests label Sep 29, 2025
@nhulston
nhulston marked this pull request as ready for review September 29, 2025 20:20
@nhulston
nhulston requested review from a team as code owners September 29, 2025 20:20

@gh123man gh123man left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

Just a sanity check @ddrthall was there a reason we wanted force gzip for serverless? (I assume whatever that reason is irrelevant now, but just wanted to double check)

@nhulston

Copy link
Copy Markdown
Contributor Author

LGTM.

Just a sanity check @ddrthall was there a reason we wanted force gzip for serverless? (I assume whatever that reason is irrelevant now, but just wanted to double check)

I did talk to @ddrthall over Slack. The reason was because we were not including zstd in our build tags, but I've updated that in DataDog/datadog-lambda-extension#878. Thanks for the review!

@nhulston

Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Sep 29, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-09-29 21:14:15 UTC ℹ️ Start processing command /merge


2025-09-29 21:14:20 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-09-29 21:38:04 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue
dd-mergequeue Bot merged commit 4f9f46a into main Sep 29, 2025
274 of 275 checks passed
@dd-mergequeue
dd-mergequeue Bot deleted the nicholas.hulston/serverless-init-use-zstd branch September 29, 2025 21:38
@github-actions github-actions Bot added this to the 7.72.0 milestone Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa/done QA done before merge and regressions are covered by tests short review PR is simple enough to be reviewed quickly team/serverless-azure-gcp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants