WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always' MongoDB Origin: Data Last updated 5 Nov 2026

MongoDB startup: WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'

Transparent Huge Pages are enabled, which can hurt MongoDB performance (latency spikes).

Exact message you may see WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'transparent_hugepage/enabled is always. We suggest setting it to never** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'Transparent Huge Pages MongoDB warning
Seen on: MongoDB Linux

Meaning

MongoDB recommends disabling THP for mongod: use the official packages (which include a service) or add a systemd unit that sets never for enabled and defrag at boot. Verify with cat /sys/kernel/mm/transparent_hugepage/enabled. A startup warning, not a failure.

Common causes

  • OS default THP=always/madvise
  • Custom install without tuning
  • Cloud images enabling THP
  • Container hosts sharing kernel settings
  • No boot-time setting persisted

⚡ Quick fix

  1. echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled (temporary)
  2. Persist via a systemd unit or tuned profile
  3. Verify after reboot

Detailed fix by platform

Linux

  1. cat /sys/kernel/mm/transparent_hugepage/enabled /sys/kernel/mm/transparent_hugepage/defrag

How to diagnose

  1. Setting — always/never?
  2. Persist — Reboot-safe?
  3. Impact — Latency?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

Atlas: bad auth: Authentication failed — MongoServerError: bad auth : Authentication failed. (Atlas user / special characters in password) (MongoDB)Atlas: bad auth: Auth…BSONObj size is invalid / exceeds maximum document size (16MB) — MongoServerError: BSONObj size: 17825792 (0x1100000) is invalid. Size must be between 0 and 16793600(16MB) (MongoDB)BSONObj size is inval…mongod killed by OOM killer — MongoDB: Out of memory: Killed process (mongod) — WiredTiger cache + queries exhausted RAM (MongoDB)mongod killed by OOM …mongod: Too many open files (ulimit warning) — MongoDB: WARNING: soft rlimits too low. Number of files is 1024, should be at least 64000 / Too many open files (MongoDB)mongod: Too many open…MongoDB Atlas: connection timed out — IP not whitelisted — MongoServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted (MongoDB)MongoDB Atlas: connec…Sort/Group exceeded memory limit of 100 MB (allowDiskUse) — MongoServerError: Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in (MongoDB)Sort/Group exceeded m…WARNING you have Transparent Huge Pages (THP) support enabled — Redis: # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis (Redis)WARNING you have Tran…WiredTiger: No space left on device — MongoDB: WiredTiger error (28) [...] No space left on device / Fatal assertion 28558 ... disk full (MongoDB)WiredTiger: No space …WARNING: …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.