Implement Memory Limiter scenario and validation tests - #3
Conversation
Automated Test Execution Report: Prometheus Memory LimiterThe validation test suite defined in the testing plan was executed against the prototype implementation. Below are the verified results across all testing tiers and operational scenarios. Test Execution Summary
Test Execution Output |
60d5b66 to
f5a1da5
Compare
Updated Comprehensive Test Execution Report (Post-Adversarial Audit)The validation test suite has been updated to incorporate the adversarial testing recommendations, including multi-target high-concurrency burst benchmarks, mixed ingestion + heavy PromQL query execution under active load shedding, and sustained overload target fairness audits. Test Execution Summary
Complete Test Output |
f5a1da5 to
6176e75
Compare
Round 2 Test Execution Report (Post-Bug Fixes & Dynamic Reload Verification)The bug fixes and edge-case remediations identified during Round 2 adversarial review have been incorporated into the prototype and validated across all test tiers. Test Execution Summary
Complete Test Output |
6176e75 to
2d52a91
Compare
Final Comprehensive Test Execution Report (Convergence Verified)All adversarial review rounds (Rounds 1, 2, and 3) have concluded with full convergence. All prototype lifecycle bugs and runtime accounting nuances have been resolved, and all scenario integration tests (S1–S9) and unit test suites pass with 100% success. Test Execution Summary
Complete Test Output |
Sustained Heavy Stress Benchmark Execution ReportIn addition to the deterministic unit and integration scenarios (S1–S9), sustained heavy memory stress benchmarks were executed to evaluate long-duration behavior under continuous high-cardinality churn and memory saturation. Stress Test Results
Full Test Suite Output |
…y limiter is disabled
Comparative Verification: Feature ENABLED vs Feature DISABLED (Baseline)As requested, all test scenarios and stress workloads were executed in comparative mode:
Comparative Evaluation Matrix
Execution Log: Baseline Comparison Suite |
…and candidate survives
Real OS-Enforced OOM Verification ReportTo definitively prove that the memory limiter prevents Out-Of-Memory (OOM) crashes under actual OS/kernel memory constraints, a dedicated OS-enforced virtual memory limit benchmark ( Benchmark Setup & Methodology
Comparative Execution Results
Full Test Suite Output |
Long-Term Overload Dynamics & Trickle Throughput ReportIn response to questions regarding whether an overloaded server suffers a total blackout or permits a continuous stream of metrics over time, empirical tests and mathematical modeling were conducted across sustained overload regimes (Scenario S10). Key Operational Findings
Empirical Execution Output |
…48% load shedding
15-Minute Continuous Sustained Overload Stress Test Execution ReportTest Target
Workload & Environmental Parameters
Telemetry Execution Progression
Key Verification Findings
Test Verdict: |
Prometheus Memory Limiter: Testing & Validation Specification
Executive Summary
The Prometheus Memory Limiter (prometheus/proposals#76) introduces an active feedback control loop to prevent Out-Of-Memory (OOM) crashes by shedding transient load.
This testing plan defines a multi-tiered validation framework to prove whether the memory limiter achieves its core design goals: protecting server availability under acute memory spikes without causing unrecoverable brownouts, data degradation during healthy operation, or unnecessary WAL overhead.
1. Evaluation of Previous Agent Review (dashpole/proposals#1#issuecomment-5181426620) & Adversarial Audit
1.1 Points of Agreement
prometheus_memory_limiter_engaged_seconds_total) and transition counters are mandatory to accurately measure duty cycles and flapping frequency.1.2 Areas of Disagreement & Technical Corrections
GOMEMLIMITGC pacer dynamically reduces effective2. Core Testing Objectives & Mathematical Foundations
2.1 The In-Use Sensor vs Working Set Gap ($C_1$ )
The Go runtime metric
/memory/classes/total:bytes - /memory/classes/heap/released:bytesmeasures anonymous memory allocated by the Go runtime. It does not include:mmap'd memory from TSDB Head chunks and block index files (MAP_SHARED/MAP_PRIVATE).sk_buff, TCP buffersrmem/wmem) charged to container cgroup.The Linux cgroup controller triggers OOM kills on
container_memory_working_set_bytes(RSS + inactive file pages that kernel cannot reclaim).Safety Criterion: The hard limit headroom must exceed the maximum unmonitored working set:
$$(1.0 - \text{hard_limit_ratio}) \times \text{GOMEMLIMIT} > \Delta_{\text{unmonitored}}$$
2.2 Zero-WAL Append Validation on Aborted Scrapes
When a scrape is aborted under Hard Limit:
3. Test Harness Architecture & Tiers
4. Detailed Scenario Specification
4.1 Tier 0: Deterministic Unit Tests
/gc/gomemlimit:bytes= 4 GiB,soft=0.70,hard=0.85limit_bytes{soft}= 2.8 GiB,limit_bytes{hard}= 3.4 GiB./gc/gomemlimit:bytes=MaxInt64(unset)/gc/limiter/last-enabled:gc-cyclewhile memory is 50%StateHardLimit.scrapeLoop.scrape()withAllowScrape() = falseon target with 100k seriesseriesPrev.transitions_total.AllowRecordingRules() = falseIterationsMissedincrements); Alerting rule evaluates and fires alerts.4.2 Tier 1: Single-Container & Multi-Target Integration Scenarios
Scenario S1: Transient Scrape Payload Burst (The Core Claim)
StateOK, and scraping resumes.Scenario S2: Flapping Dynamics Under Boundary Load
transitions_total).Scenario S4: Zero WAL Contamination
custom_sensor_datareturns 0 samples, verifying that skipped scrapes do not persistup=0or staleness markers to WAL.Scenario S5: Ingestion & Federation 503 Rejection
/federate,/api/v1/write, and/api/v1/otlp/v1/metricsunder active Hard Limit.503 Service UnavailablewithRetry-After: 5header.Scenario S6: Adversarial Concurrent Multi-Target Burst
StateOK.Scenario S7: Mixed Ingestion & Heavy PromQL Concurrent Execution
Scenario S8: Sustained Overload Target Fairness Audit
Scenario S9: Dynamic Config Reload & Runtime Enforcement Shifts
fail_scrapes) viaPOST /-/reload.Scenario S10: Sustained Overload Trickle Throughput & Duty-Cycle Dynamics
4.3 Sustained Heavy Stress & Real OS OOM Benchmarks
TestStress_15MinuteSustainedOverload50PercentShedding):GOMEMLIMIT=64MiB.TestRealOOM_BaselineCrashesVsCandidateSurvives):StateOKupon load abatement.5. Tier 2: 3-Arm Prombench Specification
5.1 Comparative Metrics & SLO Targets
6. Definitive Pass / Fail Criteria (Kill Gates)
The proposal is declared SOUND and PRODUCTION-READY if and only if all the following conditions are satisfied:
StateOKwithinprometheus_memory_limiter_engaged_seconds_totalis exactly0.