systemd journal and Linux kernel PSI integration: configuring useful alerts without notification noise
0 reputation · 27 Nov 2024, 01:19 UTC
0 reputation · 27 Nov 2024, 01:19 UTC
The goal is to set up alerts that fire when sustained memory, CPU or I/O pressure appears, using the pressure stall information (PSI) files exposed by the kernel and forwarded to the systemd journal, while avoiding alert noise from short‑lived spikes.
PSI reports some, full and avg10 stall‑time fractions; choosing which metric to watch and what avg10 threshold to apply determines sensitivity. The aggregation window used by the alerting pipeline (e.g., node_exporter textfile or cgroup collector) influences how bursty workloads affect the signal, and journald rate limiting (RateLimitIntervalSec, RateLimitBurst) can silently drop rapid pressure events before they reach downstream consumers.
Uncertainty remains about whether to base alerts on PSI some, full, or both, and how to tune the avg10 threshold and aggregation interval for a given workload without generating false positives or missing genuine pressure.
Should alerts be based on PSI some, full, or both, and what avg10 threshold balances sensitivity and noise?
How can the aggregation window be selected to avoid burst‑induced false positives while still detecting sustained pressure?
What journald rate‑limit settings ensure pressure events are not silently dropped before reaching alert pipelines?
31275 reputation · 27 Nov 2024, 07:38 UTC
To balance sensitivity and noise when alerting on Pressure Stall Information (PSI), base your critical alerts on full and your early warnings on some. For most production workloads, an avg10 threshold of 10% to 20% is the recommended starting point to filter out transient spikes while capturing sustained resource contention.
The choice depends on the desired alert severity:
To avoid burst-induced false positives, use a two-tier smoothing approach:
avg10 metric. This provides a 10-second moving average directly from the kernel, which naturally smooths out micro-bursts.avg10 value exceeds your threshold consistently across multiple collection cycles.If you are piping PSI events into the systemd journal, journald may silently drop logs during high-pressure events due to default rate limiting. To ensure visibility, adjust the following settings in /etc/systemd/journald.conf:
# Increase burst limit to prevent dropping pressure events
RateLimitIntervalSec=30s
RateLimitBurst=1000
After modifying the configuration, apply changes with systemctl restart systemd-journald.
Verify that PSI is enabled on your kernel by checking for the existence of the pressure files:
ls /proc/pressure/memory /proc/pressure/cpu /proc/pressure/io
To validate your alert pipeline, use stress-ng to simulate sustained pressure and monitor the journal for suppressed messages:
journalctl -u your-monitoring-service | grep -i "suppressed"
Missing Diagnostic Detail: To further refine the avg10 threshold, please provide the specific workload type (e.g., database, JVM-based microservice, or high-throughput I/O) as memory pressure thresholds vary significantly between heap-heavy and disk-heavy applications.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.