MongoDB 8.0 WT Improvements (TCMalloc, ExpressPlan)
Parent: WiredTiger Storage Engine Internals · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-ae873d2f56e0
↓ Facts as markdownall context files
Source-anchored research for MongoDB 8.0 WT Improvements (TCMalloc, ExpressPlan). Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Structure and components
- Percona's December 2025 test compares whole Percona Server versions 7.0.26-14 and 8.0.16-5 on Ubuntu 24.04 with four CPUs, 4 GB RAM and four workload threads. It reports gains that vary by operation. Because the versions contain multiple changes, these results do not isolate TCMalloc's contribution. (low confidence) [source]
- Treat TCMalloc and ExpressPlan as changes at different layers when analyzing WiredTiger performance: the former changes allocation and memory reuse, while the latter reduces query planning work before storage-engine access. Neither source establishes a replacement of WiredTiger’s on-disk structures. (medium confidence) [source]
How it works
- [redacted] reports that Express may perform shard filtering even when explain shows only EXPRESS_IXSCAN. Absence of a separate SHARDING_FILTER node in that output is therefore insufficient evidence that filtering was skipped. (low confidence) (verified as of 2025-09-23) [source]
- TCMalloc per-CPU mode relies on Linux restartable sequences (rseq) to update CPU-local allocation structures without locking. MongoDB documents fallback to per-thread caches when glibc registers rseq first. (high confidence) [source]
How-to and procedures
- Check serverStatus.tcmalloc.usingPerCPUCaches and tcmalloc.tcmalloc.cpu_free to verify activation; MongoDB's tuning guide expects true and a positive byte count, respectively. MongoDB 8.0 also adds peak_memory_usage and per-CPU overflow/underflow metrics; serverStatus with tcmalloc:2 includes the cpuCache section. (high confidence) [source]
- To confirm per-CPU caching, inspect serverStatus.tcmalloc.usingPerCPUCaches for true and tcmalloc.tcmalloc.cpu_free for a positive value. MongoDB documents GLIBC_TUNABLES=glibc.pthread.rseq=0 before mongod starts and Linux kernel 4.18 or later when diagnosing disabled per-CPU caches. The kernel minimum alone does not establish compatibility with every newer kernel. (high confidence) [source]
Measurements and reference values
- The documented upgraded-allocator platforms are supported Linux x86_64 and ARM64 systems. The same documentation says PPC64LE, s390x and Windows retain legacy TCMalloc, and instructs PPC64LE/s390x users to disable THP. (low confidence) [source]
- A May 2024 WiredTiger investigation, WT-13045, reported an approximately 5–6% medium-btree regression correlated with enabling new TCMalloc in performance tests. The workload built a 5 GB tree and used 16 random-read threads for two minutes. Increased resident memory reducing kernel page-cache capacity was a proposed explanation, not an established cause or proof of a regression in every released 8.0 build. (low confidence) (verified as of 2024-05-26) [source]
- Percona traced a Docker allocator misconfiguration to getMemorySizeLimitInBytes in vendored cpu_cache.cc: atoll interpreted the cgroup value 'max' as zero. Its March 2026 account reports a fix shipped in Percona Server 8.0.16-5 and 36–60% higher throughput in four tested YCSB cases. These are fix-specific results, not general MongoDB 8.0 speedups. (low confidence) (verified as of 2026-03-12) [source]
- Percona’s February 4, 2025 mongo-perf comparison of Percona Server for MongoDB 8.0.4 and 7.0.15 reported average improvements of 12%, 7% and 9% at one, four and eight threads respectively. It also reported some slower four-thread cases. These are results for that setup, not a universal speedup or an allocator-only measurement. (low confidence) [source]
Problems, failure modes and limitations
- TechEmpower's March 2026 benchmark account distinguishes a TCMalloc Docker workaround from client connection-pool changes: its spring-mongo query result rose from 583 to 837 requests/s with the allocator workaround, and to 14.2k with both changes. The headline roughly 25x improvement therefore cannot be attributed to TCMalloc alone. (low confidence) (verified as of 2026-03-16) [source]
- The cached MongoDB 8.0 release notes warn that the vendored TCMalloc is incompatible with Linux kernels 6.19 through 7.0.13 and recommend kernel 7.0.14 or later. They describe a startup guard against affected kernels. Recheck exact server patches, architecture and distribution backports before applying this warning operationally. (low confidence) (verified as of 2026-10-14) [source]
Comparisons and alternatives
- Per-CPU TCMalloc caches objects by logical CPU; its rseq fast path avoids locks. Per-thread caches can accumulate memory with thread count. This allocator mechanism concerns malloc/new and free/delete, rather than defining WiredTiger's page-cache policy. (medium confidence) [source]
- ExpressPlan addresses query-layer overhead: MongoDB's engineers traced simple _id lookups through general planning before IDHACK, then developed an Express path that bypasses regular planning for eligible queries. Treat it as a faster route to storage access, rather than a new WiredTiger on-disk format. (high confidence) [source]
- [redacted] records a possible tradeoff: choosing Express immediately for an eligible prefix can prevent an SBE-eligible $lookup pipeline from taking a faster path. The ticket proposes tests; it does not establish a MongoDB 8.0-wide slowdown or identify an affected release. (low confidence) (verified as of 2026-04-27) [source]
Facts and statements
- MongoDB 8.0 upgraded TCMalloc from per-thread to per-CPU caches on supported platforms, with the stated aims of reducing fragmentation and improving resilience under high-stress workloads. This is a server allocator change that also affects storage-engine allocations. (high confidence) [source]
- MongoDB 8.0 documents Express execution for a limited query set, including _id equality lookups. Explain stage names include EXPRESS_CLUSTERED_IXSCAN, EXPRESS_IXSCAN, EXPRESS_DELETE and EXPRESS_UPDATE; the feature does not imply that arbitrary queries skip planning. (high confidence) [source]
- For the upgraded allocator, MongoDB 8.0 documentation reverses the older THP recommendation: enable Transparent Huge Pages before mongod starts. This recommendation must be read together with allocator platform support; it is not a blanket instruction for every MongoDB platform or older release. (high confidence) [source]
- Per-CPU caches require rseq support. MongoDB documents Linux kernel 4.18 or later and disabling glibc rseq registration with GLIBC_TUNABLES=glibc.pthread.rseq=0; without usable rseq the allocator falls back to per-thread caches. A minimum kernel version is not a complete compatibility guarantee. (high confidence) [source]
- Per-CPU allocation caches avoid the thread-count scaling of legacy per-thread caches: Google documents a cache per logical CPU, with most cached allocations and deallocations avoiding locks. The middle-end still uses mutex-protected transfer caches and central free lists; the allocator is not universally lock-free. (high confidence) [source]
- ExpressPlan reduces the overhead before storage-engine access for eligible simple operations. MongoDB describes its origin in improving the _id IDHACK path and its expansion to updates, deletes and other unique-index lookups; the 8.0 explain documentation explicitly limits EXPRESS to a subset of queries that bypass regular planning. (high confidence) [source]
- End-to-end version benchmarks do not isolate the gain from TCMalloc or ExpressPlan. Percona compared Percona Server for MongoDB 8.0.16-5 and 7.0.26-14 with multiple workload mixes, while MongoDB describes numerous concurrent 8.0 optimizations; attributing the whole release gain to the allocator is unsupported by that experiment. (medium confidence) [source]
Children
- TCMalloc per-CPU allocation caches and rseq (frontier)
- ExpressPlan eligibility and EXPRESS explain stages (frontier)
- Transparent Huge Pages configuration for MongoDB 8.0 (frontier)
Frontier under this node: ExpressPlan eligibility and EXPRESS explain stages, TCMalloc per-CPU allocation caches and rseq, Transparent Huge Pages configuration for MongoDB 8.0