#Why DragonflyDB is required
Accelerate Guru uses DragonflyDB as its caching layer. DragonflyDB is a modern, open-source, Redis-compatible in-memory store. It speaks the exact same protocol as Redis — every Redis client works with it out of the box — but it is architecturally different in ways that matter for Magento workloads.
#DragonflyDB vs Redis: why it matters
| Redis | DragonflyDB | |
|---|---|---|
| Architecture | Single-threaded event loop | Multi-threaded, shared-nothing |
| Throughput (commodity server) | ~100K ops/s | ~1M–4M ops/s |
| Memory efficiency | Baseline | 30–40% less RAM for same data |
| Latency at load | Degrades under heavy load | Stays flat |
| License | BSD + SSPL (v7+) | BSL 1.1 (free for all uses) |
| Redis compatibility | Native | Full protocol compatibility |
| Installation | Manual tuning required | Works well with defaults |
For a Magento store at peak traffic (product launches, sales events), Redis can become a bottleneck. DragonflyDB scales with available CPU cores and never becomes the bottleneck — it is routinely faster than the network itself.
Note
If you already have a Redis instance running, Accelerate Guru can connect to it. Point redis_host / redis_port at your Redis server. You will not get the throughput benefits of DragonflyDB, but everything else works identically.
#Install DragonflyDB
#Ubuntu / Debian
# Import the signing key
|
# Add the repository
|
# Install
&&
# Enable and start
#RHEL / Rocky Linux / AlmaLinux / CentOS Stream
# Add the YUM repo
#macOS (Homebrew)
#Docker
Tip
The --ulimit memlock=-1 flag is important — DragonflyDB uses mlock to pin pages in RAM and avoid latency spikes from page faults. Without it, performance degrades under memory pressure.
#Manual binary install
# Download the latest binary
|
#Verify it is running
Expected response: PONG
If redis-cli is not installed:
# Ubuntu / Debian
# RHEL / Rocky
# macOS
Additional verification — check that DragonflyDB is listening:
|
# → dragonfly_version:1.x.x
#Recommended configuration for Magento workloads
DragonflyDB works well with its defaults. For production, consider adding a configuration file at /etc/dragonflydb/dragonflydb.conf (or passing flags to the unit):
# /etc/dragonflydb/dragonflydb.conf
# Bind only to loopback — do not expose to the network
bind 127.0.0.1
port 6379
# Maximum memory. DragonflyDB evicts LRU entries when this is reached.
# Set to 60-70% of available RAM, leaving room for Accelerate Guru and OS.
maxmemory 4gb
maxmemory-policy allkeys-lru
# Persist to disk for faster warm restart after reboot (optional)
# dbfilename dump.rdb
# dir /var/lib/dragonflydb
For the systemd unit, pass flags via the ExecStart override:
Add:
[Service]
ExecStart=
ExecStart=/usr/bin/dragonfly --bind 127.0.0.1 --port 6379 --maxmemory 4gb
#Connect Accelerate Guru to DragonflyDB
In /etc/accelerate-guru/magento_ultra.ini:
[cache]
enabled = true
redis_host = 127.0.0.1 ; DragonflyDB host
redis_port = 6379 ; DragonflyDB port
redis_password = ; leave empty if no auth
redis_db = 0 ; database index (0–15)
Tip
If DragonflyDB is on a different server, replace 127.0.0.1 with its private IP address. Use a private/VPC network — never expose DragonflyDB on a public IP.
#What happens without DragonflyDB
If DragonflyDB is not running or not reachable when Accelerate Guru starts:
- Accelerate Guru logs a warning at startup:
Cache disabled — cannot reach DragonflyDB at 127.0.0.1:6379 - The proxy continues running as a transparent pass-through — all requests are forwarded to Magento.
- All other features (WAF, image optimisation, HTML rewriting, compression) continue to work.
- Performance will be significantly lower than with caching enabled.
This means your store never goes down because DragonflyDB is unavailable — Accelerate Guru degrades gracefully.
Once DragonflyDB comes back online, caching resumes automatically on the next request without a restart.
#DragonflyDB and Magento's own Redis
If your Magento installation already uses Redis for session storage or the built-in Full Page Cache, you have two options:
Option A (recommended): Run DragonflyDB on a different port
Then in magento_ultra.ini:
[cache]
redis_port = 6380
Option B: Share the same DragonflyDB instance
Use a different database index:
[cache]
redis_db = 2 ; Magento typically uses db 0 and db 1
Accelerate Guru stores all its cache keys prefixed with sa: (page cache), sa:asset: (CSS/JS), sa:img: (images), and sa:dim: (image dimensions), so there is no collision risk — but separate instances are cleaner.
#Security
DragonflyDB (like Redis) has no authentication by default. Always:
- Bind to
127.0.0.1(loopback) or a private network interface, never0.0.0.0on a public server. - Set a password if DragonflyDB is accessible over a network:
; In dragonflydb.conf
requirepass your-strong-random-password
; In magento_ultra.ini
[cache]
redis_password = your-strong-random-password