如何限制 redis 的内存

文章目录

    https://redis.io/topics/lru-cache

    /etc/redis.conf

    maxmemory 100mb

    Failed to stop redis.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
    See system logs and ‘systemctl status redis.service’ for details.

    如何查看单个进程的内存占用

    redis 默认没有最大内存限制

    By Default maxmemory has no limits on 64-bit redis installation and on 32-bit installation it is 3GB.

    You can set/change memory limit used by redis by setting maxmemory variable in redis.conf at ,

    “/etc/redis/redis.conf”

    For example if you want to set it to 512mb, you need to make an entry in redis.conf , like :

    maxmemory 512mb

    参考

    • https://community.rtcamp.com/t/what-is-the-default-max-memory-limit-for-redis/4853
    • https://redis.io/topics/lru-cache

    关于作者 🌱

    我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊,或者关注我的个人公众号“大象工具”, 查看更多联系方式