Score:0

redis-server takes a long time to load in memory the dataset at boot

pg flag

My Linux distribution uses the redis database. At boot the redis-server needs about 80 seconds to load the dataset. The following is a log that shows what I have written:

redis-server[249]: 249:M 17 Oct 2022 16:29:55.173 * DB loaded from append only file: 79.442 seconds

If a Python program tries querying the database before the redis-server finishes the loading in memory operation, it is raised the Exception: redis.exceptions.BusyLoadingError.
The Exception message error is: Redis is loading the dataset in memory and is compliant with the context that I have described.

Because I'm using the default configuration of redis-server in this moment I don't know exactly what is the type of persistence used by redis-server. The file redis.conf is very long so, here, I report settings that I think are most important:

...
################################ SNAPSHOTTING  ################################
#
# Save the DB on disk:
#
#   save <seconds> <changes>
#
#   Will save the DB if both the given number of seconds and the given
#   number of write operations against the DB occurred.
# OE: tune for a small embedded system with a limited # of keys.
save 120 1
save 60 100
save 30 1000

############################## APPEND ONLY MODE ###############################
# OE: changed default to enable this
appendonly yes

# The name of the append only file (default: "appendonly.aof")
appendfilename "appendonly.aof"
...

These settings seem indicate that the database is using the persistence type: Append Only File (AOF). I think these configuration cause a so long loading time.

Is it possible to use settings that avoid a too long loading time at boot?

Score:1
za flag

Redis is a disk-backed all-in-memory database, so either you diminish your database size for initial load, or you give redis faster disks; that's all the alternatives you have. This isn't related whether your configuration uses aof or not: on the initial load redis will have to read all the data regardless of the number of files it's in.

frankfalse avatar
pg flag
Thank you very much.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.