D
D
Dmitry Bashinsky2020-08-11 16:00:35
Redis
Dmitry Bashinsky, 2020-08-11 16:00:35

Why is Redis deleting my data that doesn't have Expire?

Hello, I picked up Redis in the docker, uploaded data (ListLeftPush) to it with a total volume of a couple of kilobytes, a couple of hours pass and my Redis becomes clean, leaving only backup1 - backup4

I upload the data without specifying Expire, in Redis UI I see that TTL -1 list, I didn’t do anything else with radish, didn’t upload data, didn’t read it, it just deletes everything after a while.

Here is a piece of my compose:

redis: 
        image: redis
        ports:
            - 6379:6379
        command:
            - "redis-server"
            - "--appendonly"
            - "yes"
        volumes:
            - "/root/redis:/data"


docker ps shows that Redis has been alive for several days.

here is the code i am uploading the data
type RedisMq(db: IDatabase) =
    interface ITransient

    member private x.GetKey<'a>() = typeof<'a>.Name |> RedisKey.op_Implicit
    member private x.GetValue item = JsonConvert.SerializeObject(item) |> RedisValue.op_Implicit


    member x.SendMessage (msg: 'a) = async {
        return! db.ListLeftPushAsync(x.GetKey<'a>(), x.GetValue msg)
    }


container logs:
1:C 11 Aug 2020 09:11:36.241 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 11 Aug 2020 09:11:36.241 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 11 Aug 2020 09:11:36.241 # Configuration loaded
1:M 11 Aug 2020 09:11:36.245 * Running mode=standalone, port=6379.
1:M 11 Aug 2020 09:11:36.245 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 11 Aug 2020 09:11:36.245 # Server initialized
1:M 11 Aug 2020 09:11:36.245 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 11 Aug 2020 09:11:36.246 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 11 Aug 2020 09:11:36.250 * DB loaded from append only file: 0.002 seconds
1:M 11 Aug 2020 09:11:36.250 * Ready to accept connections
1:M 11 Aug 2020 11:53:14.304 * DB saved on disk
1:M 11 Aug 2020 11:53:14.434 * DB saved on disk
1:M 11 Aug 2020 11:53:14.512 * DB saved on disk
1:M 11 Aug 2020 11:53:14.536 * DB saved on disk
1:M 11 Aug 2020 11:53:14.918 * DB saved on disk
...
1:M 11 Aug 2020 12:28:36.124 * DB saved on disk


Perhaps this is important:
all this is deployed on debian
in docker swarm, one machine

Please help me, it's convenient for me to use Redis as an MQ broker, I tried to climb over to kafka or pulsar - this is a sparrow tank

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question