Why does the redis-server take too long to load in memory the database at boot?
0
votes
1
answer
1623
views
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: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
has finished the loading in memory operation, it is raised the Exception: redis.exceptions.BusyLoadingError
.
The Exception description is: Redis is loading the dataset in memory
and is compliant with the context that I have described (that is the database is loading data in memory).
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
#
# 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 (in particular appendonly yes
) seem indicate that the persistence type used by the database is: Append Only File
(AOF
).
I think these settings are causing this long loading time.
Is it possible to use settings that avoid a too long loading time at boot?
Asked by User051209
(498 rep)
Oct 17, 2022, 03:43 PM
Last activity: Apr 29, 2025, 04:46 AM
Last activity: Apr 29, 2025, 04:46 AM