A cPanel host with under a thousand mailboxes rarely needs tuning beyond cPanel’s defaults. At 10,000+ mailboxes, the defaults bite: Exim queue runners step on each other, Dovecot processes hit OS-level limits on open files, the filesystem (especially ext4 with default journaling) chokes on maildir small-file IO. Tuning here is not optional — it’s the difference between a server that handles its base and one that’s perpetually backlogged.
What’s happening
cPanel’s default Exim configuration sets queue_run_max to a modest number, which is fine for hundreds of mailboxes and inadequate for tens of thousands. Dovecot’s default process limits, mailbox indexes, and connection handling assume a smaller deployment. The Linux kernel’s open-file and inotify limits — nofile, fs.inotify.max_user_watches — were chosen for desktops. Each of these caps you hit before mail volume actually requires it.
How to verify
Audit the current limits and live usage:
ulimit -n
sysctl fs.inotify.max_user_watches
exim -bP | grep -E "(queue_run_max|smtp_accept_max)"
doveconf | grep -E "(process_limit|client_limit|service_count)"
ss -s
df -i /var
The last command shows inode usage — maildir storage can exhaust inodes long before bytes if many small files accumulate.
The fix
-
Raise file descriptor limits in
/etc/security/limits.confand the systemd unit overrides for Exim and Dovecot:exim soft nofile 65535 exim hard nofile 65535 dovecot soft nofile 65535 dovecot hard nofile 65535Verify with
cat /proc/$(pgrep -f exim)/limits | grep "Max open files". -
Tune Exim’s queue concurrency.
queue_run_max = 20is reasonable for 10K accounts; raise to 50 if the host has the CPU and the queue is consistently backlogged. Also raisesmtp_accept_maxto 200+. -
Tune Dovecot processes. Raise
process_limitandclient_limitin/etc/dovecot/conf.d/10-master.conffor the imap-login and pop3-login services. For 10K mailboxes with active clients, 1000+ processes is normal. -
Choose filesystem features that suit maildir. ext4 with
noatimeanddir_indexis fine; XFS handles small-file IO better at scale. If on ext4, ensurenoatimeis mounted to avoid every read updating access times. -
Move heavy mailbox storage to dedicated volumes. A single disk holding root + mail at high IO is a contention point; split mail to a separate physical or virtual disk.
-
Monitor the actual bottleneck.
iostat -xz 1,vmstat 1, and Dovecot’sdoveadm statsshow what’s actually constrained. Tune what the data points at, not what you assume.
For cPanel deployments crossing the 10K-mailbox threshold, Stack Harbor handles the tuning and the ongoing monitoring as part of environment management.