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

Sizing IMAP IDLE Sockets, ulimit -n & Epoll File Descriptors

Prevent Too Many Open Files errors when 100+ users leave Thunderbird, Apple Mail, and mobile IMAP IDLE connections open simultaneously.

ulimit -n >= 8192 · ~8 FDs/Account · 150 KB/Idle Socket

Sizing IMAP IDLE Sockets, ulimit -n & Epoll File Descriptors
Mail engineering baseline verified 2026-10-29 by JMAPRelay Foundry.

Why Each IMAP Client Opens Three to Five Parallel Connections

Desktop clients like Thunderbird and Apple Mail keep separate persistent TCP sockets open for INBOX IDLE, Sent, Drafts, and background folder fetches. Multiply active seats by 4x plus RocksDB SSTable handles when sizing LimitNOFILE.

Tokio Async Epoll Efficiency in Rust

Unlike preforked Dovecot worker processes that consume several megabytes per connection, Stalwart handles thousands of idle TLS sockets inside Tokio epoll loops at roughly 150 KB per connection.

Measured Thresholds & Stalwart Configuration Parameters

Active MailboxesExpected Concurrent SocketsMinimum systemd LimitNOFILE
10 - 25 Mailboxes40 - 120 TCP sockets4096
50 - 150 Mailboxes200 - 650 TCP sockets8192 - 16384
250 - 1,000 Mailboxes1,000 - 4,000 TCP sockets32768 - 65536
ulimit -n >= 8192 · ~8 FDs/Account · 150 KB/Idle Socket Deploy Vultr NVMeInterServer Slice