Skip to main content
STALWART JMAPRELAY FOUNDRY // JMAP + IMAP + SMTP RUST MAIL SIZING STUDIO ROCKSDB + TANTIVY FTS | VULTR PORT 25 PTR | INTERSERVER STORAGE SLICE | 2026-10-29
StalwartMailVPS
StalwartMailVPS Affiliate Notice: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero added cost (Affiliate Policy).
RocksDB & Port 25 Tuning

Tuning RocksDB block-cache-size vs write-buffer-size RAM

Prevent Linux OOM kills during heavy IMAP folder syncs by bounding RocksDB uncompressed block caches and memtable flush buffers.

65% Block Cache / 35% Memtable · Max 40% of Host RAM

Tuning RocksDB block-cache-size vs write-buffer-size RAM
Mail engineering baseline verified 2026-10-29 by JMAPRelay Foundry.

Why Unbounded RocksDB Caches Starve Linux Page Cache

RocksDB allocates its block cache in user space while Tantivy relies heavily on OS page cache via memory-mapped files. Reserving more than 40% of total VPS RAM for RocksDB starves Tantivy mmap reads and forces disk thrashing during multi-user searches.

Sizing Write Buffers for Burst Ingestion

During initial imapsync migrations, increase write-buffer-size slightly and enable lz4 SSTable compression so burst writes flush sequentially without stalling IMAP APPEND commands.

Measured Thresholds & Stalwart Configuration Parameters

Host RAM Tierblock-cache-sizewrite-buffer-size
2 GB VPS (VC2 / Storage)256 MB (or use SQLite)64 MB (2 buffers max)
4 GB VPS (HF / KVM 2)512 MB - 768 MB128 MB - 192 MB
8 GB VPS (HF 8 GB)1,536 MB - 2,048 MB256 MB - 512 MB
65% Block Cache / 35% Memtable · Max 40% of Host RAM Deploy Vultr NVMeInterServer Slice