About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
-LOADING Redis is loading the dataset in memory is Redis telling a client that the server is up but has not finished reading its dataset from disk, so it will not run the command yet. Nothing is wrong with the command. Ask Redis how far the load has got with INFO persistence, wait until loading shows 0, and only look for a fault if the load repeats or never finishes.
What the error means
In src/server.c at both redis/redis tag 7.4.1 and tag 8.0.0, the server defines the reply -LOADING Redis is loading the dataset in memory. Its command check says that while the server is loading, and is not loading asynchronously, a command is rejected with that reply unless it carries the loading flag.
Redis's command documentation defines that flag: "loading: the command is allowed while the database is loading." In the command definitions at both tags, src/commands/info.json lists the flags LOADING, STALE and SENTINEL, and src/commands/ping.json lists FAST and SENTINEL. Our own reading of the two: INFO answers during a load and PING is refused with LOADING, so a health check built on PING reports not ready until the load ends, which is accurate.
Redis's persistence page explains why a start-up has something to load. With AOF, the logged operations "can then be replayed again at server startup, reconstructing the original dataset", and "RDB allows faster restarts with big datasets compared to AOF." If both are enabled, the same page says "the AOF file will be used to reconstruct the original dataset". The load time therefore depends on the size of the file Redis reads, and on which file it is.
A replica loads too. The replication page says that after the initial sync, "The replica will block incoming connections during this brief window (that can be as long as many seconds for very large datasets)." The INFO page also describes async_loading: "Currently loading replication data-set asynchronously while serving old data." In that mode the first check does not apply, and the replica serves its old data. Our own reading of src/server.c: a second check still returns the same -LOADING reply for commands flagged as not allowed during asynchronous loading.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| The server has just started and is reading its file | loading is 1 and progress rises |
INFO persistence, then INFO server for a small uptime_in_seconds |
| A large dataset, or a slow disk | Progress rises, but the estimate is long | loading_eta_seconds and the byte counts |
| A replica is loading the data it received from its master | LOADING on the replica only |
INFO persistence on the replica shows loading:1; INFO replication shows master_sync_in_progress (our own reading: it is 1 while the replica takes in the data) |
| Redis restarts repeatedly, so every load begins again | uptime_in_seconds is always small |
Two INFO server readings a few minutes apart |
| A health check or client sends commands during the load | Probe failures with this message | The check uses PING or a data command |
Prove the cause before changing anything
All of these only read. The redis-cli page shows -h <hostname> (default 127.0.0.1) and -p <port> (default 6379); add them for a remote server, and the authentication option if a password is set.
- Read the load state:
redis-cli -h db01.example.com -p 6379 INFO persistence
The INFO page defines loading as a "Flag indicating if the load of a dump file is on-going". "If a load operation is on-going, these additional fields will be added": loading_start_time, loading_total_bytes ("Total file size"), loading_loaded_bytes ("Number of bytes already loaded"), loading_loaded_perc ("Same value expressed as a percentage") and loading_eta_seconds ("ETA in seconds for the load to be complete"). A good result is loading:0. A bad result is loading:1 with loading_loaded_bytes that does not grow.
-
Read it a second time after a known interval, and compute the rate yourself. Rate = (second
loading_loaded_bytesminus first) divided by the seconds between the readings. Time left = (loading_total_bytesminus secondloading_loaded_bytes) divided by that rate. Compare the answer withloading_eta_seconds. -
Check how long this process has been running. The
INFOpage definesuptime_in_secondsas the "Number of seconds since Redis server start":
redis-cli -h db01.example.com -p 6379 INFO server
If you see LOADING again later and uptime_in_seconds is lower than before, the server restarted in between. That points to a restart loop, not to a slow load.
- On a replica, read the replication section:
redis-cli -h db01.example.com -p 6379 INFO replication
The page defines master_sync_in_progress as "Indicate the master is syncing to the replica", and master_link_status as the status of the link, up or down.
Fix
The load is in progress
No change is needed. Wait until loading shows 0.
Risk: restarting the Redis service or container to hurry the load interrupts the server mid-load. Our own reading: a restart begins the load again from the start, so the progress made is lost and clients wait longer. Our own advice is to leave it running.
Our own advice: clients should treat LOADING as a temporary refusal and retry with a short, growing delay. Redis's own reply carries no wait time, so choose a limit that suits the application. This is a change to client code and settings, not to Redis.
A health check uses PING
By the command flags above, a PING check reports failure during a load. Where that is the intended meaning, not ready until the data is loaded, leave it. Where the check must tell "loading" from "down", use INFO and read the loading field. Our own reading: a PING that returns LOADING shows that the server process is alive.
The load keeps starting over
uptime_in_seconds shows the restarts, but not their cause. Read the service manager's log for the Redis unit or container for the reason, such as a kill for memory or a crash. The restart policy of a container or service can bring Redis back each time, which begins another load. Our own advice: fix the cause of the restarts first. Tuning the load time does not stop a loop.
If Redis does not come up at all, clients see no LOADING reply. The persistence page shows a start-up that stops on an AOF file with invalid data in the middle, with a message that begins "Bad file format reading the append only file". That is a different fault, and the page's steps for it start with a backup copy of the AOF file.
A long load every time
The persistence page's own comparison is that RDB restarts faster than AOF on big datasets. Moving between persistence modes is a configuration change with its own data-loss warnings on that page, so read it in full before you consider it.
Example (illustrative): On db01, Redis is restarted at 02:00 after a kernel update. At 02:03 app01 logs LOADING Redis is loading the dataset in memory. INFO persistence shows loading:1, loading_total_bytes 8,589,934,592 and loading_loaded_bytes 2,147,483,648, which is 25%. Sixty seconds later, at 02:04, loading_loaded_bytes is 2,684,354,560. Rate = (2,684,354,560 - 2,147,483,648) / 60 = 8,947,848.5 bytes per second. Left = 8,589,934,592 - 2,684,354,560 = 5,905,580,032 bytes, and 5,905,580,032 / 8,947,848.5 = 660 seconds, 11 minutes. That agrees with loading_eta_seconds, so the administrator waits. At 02:15 INFO persistence shows loading:0 and the application recovers.
Confirm the fix
INFO persistenceshowsloading:0.- A data command, such as a read of a key you know exists, returns the value and not
LOADING. uptime_in_secondskeeps growing across two readings, so there is no restart loop.- On a replica,
master_link_statusis up andmaster_sync_in_progressis 0.
What to watch afterwards
- Record how long a normal start takes, from
loading_start_timeand the momentloadingreturns to 0. Plan restarts and kernel updates around it. - Alert on
uptime_in_secondsfalling, not only on commands failing. - Make sure clients and probes distinguish a starting server from a failed one.
- If the dataset grows, the load time grows with it. The file size in
loading_total_bytestells you how much.
Read next
Related articles you may want next.
- TroubleshootingRedis MISCONF: unable to persist to disk (RDB snapshots failing, writes refused)Redis MISCONF Redis is configured to save RDB snapshots but is unable to persist to disk: find the failed BGSAVE cause and restore writes safely.Read article
- Backup & RecoveryRedis backups: RDB snapshots, the append-only file and what a restore really gives youHow Redis persistence works for backup: RDB snapshots, the append-only file, safe copying, newer backup commands, replication risks and restore checks.Read article
- TroubleshootingRedis OOM command not allowed when used memory > 'maxmemory'Redis OOM command not allowed when used memory > 'maxmemory': read INFO memory, pick the right eviction policy, set TTLs or raise the limit safely.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The
INFOfields apply to the Redis documentation's latest version; older servers may lack some, such asasync_loading, which the page marks as added in Redis 7.0. - The check on command flags is read from
src/server.cat tags 7.4.1 and 8.0.0. Other releases may differ. - The estimate in
loading_eta_secondsis Redis's figure for the file being loaded. A slower disk, or competing work on the host, can change the real finish time. - Our own reading: restarting Redis during a load starts the load again. The persistence page warns that changing persistence settings without its procedure "can result in data loss".
Sources
- Redis persistence — Redis Docs, no date shown, accessed 3 December 2026
- INFO — Redis Docs, no date shown, accessed 3 December 2026
- COMMAND — Redis Docs, no date shown, accessed 3 December 2026
- Redis replication — Redis Docs, no date shown, accessed 3 December 2026
- Redis CLI — Redis Docs, no date shown, accessed 3 December 2026
- server.c — redis/redis source, tag 7.4.1, no date shown, accessed 3 December 2026
- server.c — redis/redis source, tag 8.0.0, no date shown, accessed 3 December 2026
- info.json — redis/redis source, tag 7.4.1, no date shown, accessed 3 December 2026
- info.json — redis/redis source, tag 8.0.0, no date shown, accessed 3 December 2026
- ping.json — redis/redis source, tag 7.4.1, no date shown, accessed 3 December 2026
- ping.json — redis/redis source, tag 8.0.0, no date shown, accessed 3 December 2026
This article was originally published on .