Skip to main content
InterviewHubPRO
Section Overview
Q27

Question 27 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

54%
Redis & Caching (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Why must Transparent Huge Pages (THP) be disabled for Redis?

senior LevelredisAdvanced Internals

In Simple Words: Linux Transparent Huge Pages (THP) allocates memory in 2 MB chunks instead of standard 4 KB pages:

  • During Copy-On-Write, writing a single 10-byte string forces the OS to duplicate an entire 2 MB memory page!
  • Causes severe memory bloat, high allocation latency, and random connection timeouts.
  • Always run: echo never > /sys/kernel/mm/transparent_hugepage/enabled.