Affected versions: CentOS Stream 9

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Postgres latency spikes on CS9

Environment & Reproduction

THP defragmentation pauses Postgres workers.

Root Cause Analysis

khugepaged compaction contends with database memory mapping.

Quick Triage

cat /sys/kernel/mm/transparent_hugepage/enabled and check perf top.

Step-by-Step Diagnosis

Run: grep -H . /sys/kernel/mm/transparent_hugepage/{enabled,defrag}.

Illustrative mockup for centos-stream-9 — cp236_diag
perf top showing khugepaged dominance — Illustrative mockup — Progressive Robot

Solution – Primary Fix

echo never > /sys/kernel/mm/transparent_hugepage/enabled and persist via tuned profile.

Still having issues? Our Managed IT Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for centos-stream-9 — cp236_fix
tuned profile disabling THP — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Switch to madvise instead of never for mixed workloads.

Verification & Acceptance Criteria

p99 query latency returns to baseline and khugepaged CPU usage drops.

Rollback Plan

Re-enable THP via tuned-adm profile switch if regression occurs.

Prevention & Hardening

Apply throughput-performance tuned profile with custom THP override.

Pairs with stalled task warnings and high sys CPU.

Related tutorial: View the step-by-step tutorial for centos-stream-9.

View all centos-stream-9 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

tuned(8) and PostgreSQL THP guidance.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.