-
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
Enable obfuscation cache for SQL and MongoDB #31336
Enable obfuscation cache for SQL and MongoDB #31336
Conversation
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 6faf2e3 Optimization Goals: ❌ Significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | otel_to_otel_logs | ingress throughput | +0.81 | [+0.12, +1.50] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency | egress throughput | +0.07 | [-0.71, +0.85] | 1 | Logs |
➖ | tcp_syslog_to_blackhole | ingress throughput | +0.06 | [+0.01, +0.12] | 1 | Logs |
➖ | file_to_blackhole_100ms_latency | egress throughput | +0.03 | [-0.69, +0.74] | 1 | Logs |
➖ | file_to_blackhole_300ms_latency | egress throughput | +0.02 | [-0.60, +0.65] | 1 | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.01, +0.01] | 1 | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.02 | [-0.12, +0.08] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency | egress throughput | -0.03 | [-0.85, +0.79] | 1 | Logs |
➖ | file_to_blackhole_500ms_latency | egress throughput | -0.06 | [-0.83, +0.71] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency_linear_load | egress throughput | -0.20 | [-0.66, +0.27] | 1 | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.53 | [-1.27, +0.20] | 1 | Logs |
➖ | pycheck_lots_of_tags | % cpu utilization | -0.84 | [-4.32, +2.63] | 1 | Logs |
➖ | quality_gate_idle | memory utilization | -1.05 | [-1.10, -0.99] | 1 | Logs bounds checks dashboard |
➖ | file_tree | memory utilization | -1.51 | [-1.65, -1.37] | 1 | Logs |
➖ | quality_gate_idle_all_features | memory utilization | -3.14 | [-3.29, -2.98] | 1 | Logs bounds checks dashboard |
✅ | basic_py_check | % cpu utilization | -5.22 | [-9.12, -1.33] | 1 | Logs |
Bounds Checks: ✅ Passed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
✅ | 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_1000ms_latency_linear_load | 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_300ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_300ms_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 | memory_usage | 10/10 | bounds checks dashboard |
✅ | quality_gate_idle_all_features | 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:
-
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".
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=50001871 --os-family=ubuntu Note: This applies to commit c8ce7d6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, only a few small comments
pkg/obfuscate/obfuscate.go
Outdated
@@ -103,6 +103,9 @@ type Config struct { | |||
// Logger specifies the logger to use when outputting messages. | |||
// If unset, no logs will be outputted. | |||
Logger Logger | |||
|
|||
// Cache enables the query cache for obfuscation for . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this line is unfinished? Maybe it should add SQL and Mongo?
@@ -273,7 +275,10 @@ func (a *Agent) loop() { | |||
a.obfuscator, | |||
a.DebugServer, | |||
} { | |||
stopper.Stop() | |||
// Fun with golang nil checks | |||
if stopper != nil && !reflect.ValueOf(stopper).IsNil() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of me thinks this reflection check isn't the ideal place to check this (I do recall the internal chat about this) - since technically there could exist a component that performs valid shutdown logic even on a nil pointer. I'm not super strong feeling here though, so this change isn't necessary for merging here.
releasenotes/notes/enable-query-cache-for-obfuscator-f662a09b27ebf1e0.yaml
Show resolved
Hide resolved
/merge |
Devflow running:
|
What does this PR do?
Motivation
Obfuscating SQL and Mongo queries can incur a substantial CPU overhead, especially of those strings are long. They should be perfectly cacheable, as the obfuscated output should never change given the same input. The query cache was added in a previous change but was not configured correctly.
Enabling the cache on a branch build shows major CPU savings for a Mongo instance:
Describe how to test/QA your changes
Once deployed there should be a drop in CPU usage for agents monitoring databases with large queries.
Possible Drawbacks / Trade-offs
Smoke testing this change on a branch build showed no substantial change in memory usage. The cache is capped at a size that should prevent memory growth.
Additional Notes
Change was deployed to
gizmo
for testing. Hit rate on the cache is close to 100% very quickly and CPU usage is steady or lower compared to previous RC. Profiling confirms theObfuscateSQLString
method is no longer consuming measurable CPU time.