Redis Requirements for EmailEngine

Minimizing Latency

To ensure optimal performance, keep the Redis server and EmailEngine in the same data center or on the same local network. High latency between Redis and EmailEngine can significantly degrade performance. If possible, avoid geographic distances or cross-regional configurations.

Memory Requirements

Provisioning

  • Choose a server with at least twice the amount of RAM you expect to need.
  • Plan for extra memory usage during periodic snapshots—normal load should not exceed 80% of available RAM.

Usage Spikes

  • Leave headroom for sudden spikes in webhook queues or other temporary workloads, which may consume additional RAM.

Keepalive Settings

Some optimization guides suggest setting tcp-keepalive to 0, but do not do this. Retain the default keepalive value of 300 to ensure stable, long-lived connections.

tcp-keepalive 300

Data Persistence

Redis Snapshots

  • Enable persistence to disk with RDB snapshots.

Append-Only File (AOF)

  • Only enable AOF if you have extremely fast disks. Note that some Linux distributions enable AOF by default.

Backups

  • Regularly back up your dump.rdb file, which stores all EmailEngine data.

Mailbox Indexing

Plan for 1–2 MB of Redis storage per email account. The decisive factor is the number of emails rather than the total byte size of a mailbox. Larger email accounts with more messages will require additional Redis storage.

Key Eviction Policies

Configure the maxmemory-policy in Redis as follows:

  • Preferred: noeviction
  • Allowed: volatile-* (e.g., volatile-lru, volatile-ttl)
  • Avoid: allkeys-* (these can evict critical EmailEngine data)

Redis Alternatives

Upstash Redis

  • Seems compatible with EmailEngine.
  • Important: Place EmailEngine and Redis in the same AWS or GCP data center to minimize latency.
  • Monitor usage carefully: EmailEngine uses a large number of Redis commands. You can not use Upstash Redis free tier because EmailEngine will exchaust all available command limits in a few minutes.
  • Command size limit: Upstash Redis caps command size at 1 MB, which can disrupt large blob operations (e.g., sending emails with large attachments).

Amazon ElastiCache

  • Reported to work with EmailEngine but acts like a cache.
  • Data loss can occur, for example, when restarting the cluster.
  • EmailEngine needs more persistent storage, so ElastiCache is not recommended.

Memurai

  • Appears to work with EmailEngine based on initial testing.
  • Production performance under heavy load is unverified.

Dragonfly

  • Appears to work with EmailEngine based on initial testing.
  • Requires enabling access to undeclared keys in Lua with either:
    export DFLY_default_lua_flags=allow-undeclared-keys
    or the command-line argument:
    --default_lua_flags=allow-undeclared-keys

KeyDB

  • Briefly tested with EmailEngine, seems compatible.
  • Long-term stability and load performance are not fully evaluated.