-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
AML-1804 Asynchronous dogstatsd flush #27256
Conversation
Instead of blocking time sampler while we flush and serialize the metrics, move closed metrics buckets out of the time sampler maps and run flush in background, unblocking time sampler to process more metrics.
Serverless Benchmark Results
tl;drUse these benchmarks as an insight tool during development.
What is this benchmarking?The The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type. How do I interpret these charts?The charts below comes from The benchstat docs explain how to interpret these charts.
I need more helpFirst off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development. If you would like a hand interpreting the results come chat with us in Benchmark stats
|
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=38165569 --os-family=ubuntu Note: This applies to commit 77646f6 |
Regression DetectorRegression Detector ResultsRun ID: 82e10bdc-dbf6-46d0-9ca5-49a277e3b470 Metrics dashboard Target profiles Baseline: b3e5cab Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
➖ | tcp_syslog_to_blackhole | ingress throughput | +8.95 | [-4.60, +22.50] | Logs |
➖ | pycheck_1000_100byte_tags | % cpu utilization | +0.82 | [-3.97, +5.61] | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.00, +0.00] | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.00 | [-0.01, +0.01] | Logs |
➖ | idle | memory utilization | -0.14 | [-0.18, -0.10] | Logs |
➖ | basic_py_check | % cpu utilization | -0.48 | [-3.09, +2.13] | Logs |
➖ | otel_to_otel_logs | ingress throughput | -0.63 | [-1.44, +0.18] | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.65 | [-1.54, +0.24] | Logs |
➖ | file_tree | memory utilization | -0.81 | [-0.90, -0.72] | Logs |
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
What does this PR do?
Add an option (off by default) to perform the bulk of the dogstatsd flushing without blocking the rest of the pipeline.
Motivation
Dogstatsd server has a queue that buffers incoming packets if they can not be processed immediately. Flushing large number of metrics can block the pipeline for a long time (around 1-2 seconds) leading to queue to buffer a lot of packets.
Additional Notes
Processing new metrics needs to write to the context map when it encounters a new metric context. At the same time, flush process reads the same map to extract context information for metrics being flushed. To avoid lock overhead, asynchronous flush instead copies the context map, which is fast (~100ms) and needs less space than the buffer queue. Then we extract and remove buckets that need to be flushed from the working set. After this, metrics processing can resume, while the flush process works in background.
Possible Drawbacks / Trade-offs
Describe how to test/QA your changes