MongoDB 8.0 Production mongod.conf (WiredTiger & Zstd)
# MongoDB 8.0+ Production Replica-Set Node Configuration (/etc/mongod.conf)
# Host sizing baseline: 32 GB RAM / 8 vCPU / XFS on NVMe SSD (Linux THP disabled)
storage:
dbPath: /var/lib/mongodb
wiredTiger:
engineConfig:
# Rule of thumb: MAX(50% of (RAM - 1GB), 256MB). Leave ~45-50% for OS page cache & aggregation memory
cacheSizeGB: 15.5
journalCompressor: zstd
zstdCompressionLevel: 6
collectionConfig:
blockCompressor: zstd
indexConfig:
prefixCompression: true
systemLog:
destination: file
logAppend: true
logRotate: reopen
path: /var/log/mongodb/mongod.log
net:
port: 27017
bindIp: 127.0.0.1,10.0.10.21
maxIncomingConnections: 2000
compression:
compressors: zstd,snappy
operationProfiling:
mode: slowOp
slowOpThresholdMs: 100
slowOpSampleRate: 1.0
replication:
replSetName: rs_prod_01
oplogSizeMB: 32768
setParameter:
# Prevent single unindexed sorts from exhausting host RAM
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600
diagnosticDataCollectionEnabled: true