• Resolved futureyoon

    (@futureyoon)


    Hi

    I would like to check how to set the maxmemory for redis?

    I know where and how to update the value

    sudo systemctl restart redis-server and then maxmemory

    My question is more like how to calculate the most optimal maxmemory for my site.

    I can simply set maxmemory 2gb as I wish?

    My memory for the virtual machine is 8gb.

    Is there any rough formula (or common practice) to set the maxmemory?

    I often exp my site freezed due to the redis crashed. It appears to be due to insufficient memory.

    Can you please recommend any?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    @futureyoon: That depends on how large your WordPress dataset is. Ideally set maxmemory to unlimited, and set a maxmemory-policy so keys get evicted and you don’t run out of memory.

    Thread Starter futureyoon

    (@futureyoon)

    @tillkruess thx for the input. i have further questions as below.

    1. how to set maxmemory unlimited?
    2. plus, i have 2gb database, what is rough recommendation of the maxmemory for my case?
    3. i have set the maxmemory-policy as allkeys-lru and changed from allkeys-lfu (becaose site was still freezed)

    please share some insights here.

    Thank you

    Plugin Author Till Krüss

    (@tillkruess)

    @futureyoon If you comment-out the maxmemory in your redis.conf it will not have a limit.

    If you have a 2GB database, you’ll probably need around 2GB for Redis Server as well, but keep an eye on it to see what it actually does.

    Thread Starter futureyoon

    (@futureyoon)

    OK. I have updated it to 2gb and will monitor.

    Is there a way for me to observe (any data, maybe from ‘redis-cli info memory’ or ‘top’) how it performs?

    I mean instead of wating for the system to hang and then see that debug.log, is there any way to check like ‘oh..it’s hitting very near the breakpoint…so i have to increase bit more’ something like that?

    Thank you

    • This reply was modified 7 months, 3 weeks ago by futureyoon.
    • This reply was modified 7 months, 3 weeks ago by futureyoon.
    • This reply was modified 7 months, 3 weeks ago by futureyoon.
    Plugin Author Till Krüss

    (@tillkruess)

    Most server monitoring tools will provide you with Redis memory statistics, but I can’t recommend a specific one.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘maxmemory’ is closed to new replies.