zoukankan      html  css  js  c++  java
  • Redis动态配制,限内存,免重启

    一、修改redis.conf。保证下次服务器或者Redis重启仍然生效

      # maxmemory <bytes>

      # 3.03GB

      # redis-cli>info

      #           >used_memory:3254690792

      maxmemory 3254857828

      maxmemory-policy allkeys-lru

      #过期key删除选项。建议开启

      lazyfree-lazy-expire yes

      # 设为9,消耗更多CPU及时回收内存

    maxmemory-samples 9

     

    # 减少slave节点flush操作时间

    slave-lazy-flush yes

     

    # 碎片整理总开关

    activedefrag yes

     

      关闭服务:$> redis-cli shutdown

      启动:$> ./redis-server redis.conf

     
    二、动态配制生效,免重启

      # redis-cli>CONFIG SET maxmemory 3254857828

           >CONFIG SET maxmemory-policy allkeys-lru

           >CONFIG SET maxmemory-samples 9

           >config set lazyfree-lazy-expire yes

           >config set activedefrag yes

  • 相关阅读:
    全排列算法(java实现) 组合算法实现
    int -2147483648 ----- 2147483647
    Gradel 多渠道打包 代码混淆
    Android开发环境搭建
    自定义相册、九宫格显示图片
    新技术:retrofit
    新技术:dagger
    主流架构:MVVP
    GreenDao3.2的使用
    第三方框架:EventBus
  • 原文地址:https://www.cnblogs.com/wujinhong/p/12179135.html
Copyright © 2011-2022 走看看