I have an actively used mail server with more than a 100 employees accounts, but the configured Redis in-memory store is storing just as much as 5mb of cache. Is that because I messed up the configuration or what could be the reason? If server uses only internal caching than why would i need Redis?
Stalwart version 0.15.5
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
5.48 MB is a reasonable footprint. Redis in Stalwart only holds short-lived, small key-value data (rate-limit counters, fail2ban records, OAuth authorization codes, ACME tokens, greylist tokens, distributed locks, Sieve auto-responder IDs). None of that is bulk email data, so its memory usage stays tiny regardless of mailbox count, message volume, or number of accounts. It is not caching your mail data, so a small size does not indicate misconfiguration.
If Redis is not configured at all, Stalwart falls back to using the primary data store (SQL/FoundationDB/RocksDB) as the in-memory store via the Default variant. Redis is recommended mainly for high-throughput or clustered deployments because it handles these ephemeral keys and expirations natively and offloads that churn from your main database, and it also provides pub/sub coordination between cluster nodes for things like IMAP IDLE and mailbox change notifications. If you’re running a single node without heavy load, a few MB is completely normal and does not mean something is misconfigured.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
5 MB is normal and does not indicate a misconfiguration. Nothing large ever goes to the in-memory store: no message bodies, no mailbox state, no search index, no directory data. What lives there is rate limit and fail2ban counters, blob quota accounting, distributed locks for tasks, the SMTP queue and WebDAV, OAuth authorization codes, ACME tokens, greylist entries and auto-responder ids, plus any lookup lists you have defined. That scales with your connection and delivery rate, not with how many accounts you have, so 100 accounts on one node producing a few megabytes is exactly the expected shape.
As for why you would need it: on a single node, largely you do not. The point of an external in-memory store is that those counters and locks are shared across nodes, so a sender throttled on one node is throttled on all of them and two nodes never run the same task at once. On one node, using your data store for it gives the same semantics with one less moving part.
The remaining single-node argument is write load, since rate limit counters are hot writes and keeping them off the data store helps on a busy server, but at your size that is not something worth optimising. stalw.art/docs/storage/in-memory has the full list of what is stored there.