dbsize reset after some time

24 views
Skip to first unread message

Martin Lehotsky

unread,
Nov 29, 2021, 7:52:12 AM11/29/21
to Redis DB
Hello,

can please someone explain what is causing Redis to reset db size to 0 (or near 0) after some time of adding new data (a limit reached?).
The problem is that we get data not found exceptions afterwards.
It looks like Redis deletes data automatically? What setting is causing this?

thanks a lot

Martin

sundb

unread,
Nov 29, 2021, 7:55:42 AM11/29/21
to Redis DB
Do you enable maxmemory-policy?
But even if you turn it on it is not possible to make the dbsize to 0.
Do you have your ports open on the external network?
If so are you using auth?

Greg Andrews

unread,
Nov 29, 2021, 11:52:23 PM11/29/21
to Redis DB
Have you checked that:
  • The redis-server process is not crashing and being re-started?
  • The redis-server process is saving its data to disk at regular intervals, with no errors reported in the log file?
The situation you describe can very easily happen if the redis-server process consumes all the server's memory, causing a crash, yet it has not been configured to successfully save its data to disk.  If the data is not saved, Redis can't restore it after a crash.  If you didn't happen to notice the crash and re-start, it will look exactly like Redis is unexpectedly erasing its data.

This is not the only possible way to encounter the symptoms you describe, but it has happened this way in the past.

Reply all
Reply to author
Forward
0 new messages