# PostgreSQL 18 NUMA optimizations require huge pages for optimal cloud performance

> **Key takeaway:** PostgreSQL 18 introduces NUMA-specific optimizations that must be paired with huge pages to prevent memory fragmentation across nodes.

**Published:** 2026-11-06T16:11:22+00:00 
**Source:** Planet PostgreSQL 
**Category:** databases-storage 
**Canonical URL:** https://fosswire.org/news/postgresql-18-numa-optimizations-require-huge-pages-for-opti.html 

## Summary
A technical deep dive into PostgreSQL's interaction with Non-Uniform Memory Access (NUMA) architectures highlights critical configuration requirements for high-performance database deployments. The analysis notes that while PostgreSQL 18 includes specific optimizations for NUMA systems, these improvements are heavily dependent on the correct implementation of huge pages.

Running PostgreSQL in modern cloud environments—often involving layers of virtualization like KVM hypervisors and Linux containers (Docker, Kubernetes)—introduces complexities in mapping virtualized resources to physical hardware. Without proper tuning, memory allocations can become interleaved across different NUMA nodes, negating the performance benefits of local memory controllers.

## NUMA, Memory Pages, and Virtualization Challenges
- **Memory Page Alignment:** Because PostgreSQL's shared buffers use 8kb pages while standard Linux allocations are 4kb, a single shared buffer page can be split across two different OS pages, potentially straddling two NUMA nodes.
- **Huge Page Requirement:** To achieve optimal performance with PostgreSQL 18's NUMA optimizations, administrators must use huge pages (typically 2MB) to ensure memory allocations are not fragmented across multiple memory controllers.
- **Virtualization Mapping:** Hypervisors like KVM can present arbitrary NUMA topologies to a guest kernel, meaning the virtual NUMA configuration may not directly reflect the underlying physical hardware topology.
- **Containerization Constraints:** Linux containers using cgroups and namespaces share the host kernel, which can complicate direct NUMA management and introduces security considerations regarding kernel-level access and live patching.

## Why it matters
Why it matters: Database administrators managing large-scale PostgreSQL deployments in the cloud must account for the abstraction layers of Kubernetes and VMs to ensure NUMA locality. Failure to align huge page settings with PostgreSQL 18's new features can lead to significant performance degradation due to cross-node memory latency.