InletDownload

Redis error LOADING

LOADING Redis is loading the dataset in memory

The server has started (or a replica is resyncing) and is still reading its data from disk into memory. Until it finishes, most commands get LOADING. Wait and retry: INFO persistence shows the progress. Then find out why it restarted.

LOADING Redis is loading the dataset in memory

Tested on Redis 8.10.2 and Valkey 8.1.10 (temporary servers with 3 million keys) · Updated 9 October 2026

What it means

Redis keeps its data in memory, so when it starts it first reads its saved data back: the RDB snapshot (dump.rdb) or the append-only file (AOF). It accepts connections while it loads but, until loading finishes, answers almost every command with:

LOADING Redis is loading the dataset in memory

It isn’t an error in your data or your command; the server isn’t ready yet. Nothing ran. INFO works during loading (it’s how you watch progress); in the test below PING, GET and DBSIZE all got LOADING.

How long it lasts depends on the size of the data and the disk. On this Mac, 3 million small keys (a 127 MB RDB, 389 MB in memory) took 2.2 seconds. Tens of gigabytes can take minutes.

Common causes

  1. A restart with a large dataset: an upgrade, a configuration change, a crash, or a container that was restarted. If the restarts repeat, look for why: a container killed for using too much memory comes back, loads, fills up and is killed again.
  2. A replica’s full resynchronisation. After a full sync a replica loads the new copy from the primary and answers LOADING meanwhile (with the default repl-diskless-load disabled).
  3. A large AOF. AOF files are usually bigger than the RDB of the same data, and Redis’s docs say RDB gives faster restarts with big datasets. When both are on, Redis loads the AOF, since it’s the most complete.
  4. A failover or scaling event on a managed service that restarts or replaces a node.

How to fix it

Wait, and watch the progress

redis-cli INFO persistence | grep -E '^loading'
loading:1
loading_total_bytes:126776450
loading_loaded_bytes:54525945
loading_loaded_perc:43.01
loading_eta_seconds:1

loading:0 means it’s done. The server log says so too: DB loaded from disk: 2.208 seconds.

Make clients retry

Treat LOADING as temporary: retry with a short back-off (say 100 ms, doubling up to a few seconds) rather than failing the request or reconnecting in a tight loop. For health checks and load balancers, a PING that expects PONG is a good readiness test: it fails while the server is loading, so no traffic arrives until it’s ready.

Shorten restarts

  • Keep the dataset smaller: TTLs on cache keys, no data you don’t read.
  • Use RDB, or keep the AOF’s base in RDB format (aof-use-rdb-preamble yes, the default), which redis.conf calls always faster than the AOF format.
  • Avoid restarts you don’t need: many settings change at runtime with CONFIG SET.
  • Put the data on a faster disk.

Replicas: serve old data during a sync

With repl-diskless-load swapdb, a replica keeps serving its current data while it reads the new copy from the primary, at the cost of holding both in memory for a while. The default (disabled) writes the copy to disk and then loads it, answering LOADING meanwhile.

Find out why it restarted

redis-cli INFO server | grep -E '^(uptime_in_seconds|redis_version)'

A small uptime_in_seconds confirms a restart. The server log, or docker logs for a container, shows the previous shutdown, a crash report, or nothing at all if the process was killed from outside (for example by the system running out of memory).

Reproduce it

A temporary Redis 8.10.2 container with the debug command turned on, filled with 3 million keys and saved:

redis-server --daemonize yes --enable-debug-command yes --save "" --dir /data
redis-cli DEBUG POPULATE 3000000 seo:load 64
redis-cli SAVE
redis-cli SHUTDOWN NOSAVE

The server was started again on the same dump.rdb with PING sent in a loop as fast as possible:

15:04:24.057 Could not connect to Redis at 127.0.0.1:6379: Connection refused
15:04:24.106 LOADING Redis is loading the dataset in memory
15:04:24.121 LOADING Redis is loading the dataset in memory
…
15:04:26.257 LOADING Redis is loading the dataset in memory
15:04:26.263 PONG

That was 239 LOADING replies over 2.2 seconds. The log:

* Loading RDB produced by version 8.10.2
* RDB age 10 seconds
* RDB memory usage when created 389.14 Mb
* Done loading RDB, keys loaded: 3000000, keys expired: 0.
* DB loaded from disk: 2.208 seconds
* Ready to accept connections tcp

In redis-cli, mid-load, GET and DBSIZE each printed (error) LOADING Redis is loading the dataset in memory, while INFO persistence answered with loading:1 and the progress shown above.

A temporary replica doing its first sync also logged MASTER <-> REPLICA sync: Loading DB in memory; with one key, that took about 20 milliseconds, too short to catch.

Valkey 8.1.10, with the same 3 million keys, names itself: (error) LOADING Valkey is loading the dataset in memory.

In Inlet

Inlet shows the message after the code, Redis is loading the dataset in memory, and links it to this page. Run the command again once loading finishes. INFO shows as a table in a query tab, so the loading fields of INFO persistence are easy to read.

Related

Sources