当前位置:网站首页>Record a CODIS memory cleanup

Record a CODIS memory cleanup

2022-06-11 12:12:00 Why is utopia occupied

background :codis One of the clusters redis-master The host system is out of memory

Ideas :

            The simplest and most effective solution is to increase the physical memory of the host

            Another way of thinking , Because the company's business has developed for many years ,redis There should be some useless items in the memory without setting the expiration time key

 

screening :

          adopt codis-dashboard Found one of them db in , There is a lot of memory , There are not many connections , You can start with this library

        adopt redis-cli Tool login to redis Start viewing in the library (redis-cli -h host -p port), use RANDOMKEY Random sampling to see some key

          Frequently confirmed with the business key Is it in use now , Can pass keys View the key The number of ( This is not reasonable , The best way is through rdb View all this key The memory occupied by )

          Know some key, You can write scripts , Clean up the by scheduled tasks key

 

clear :

        redis-cli -h host -p port -a password -n 4 keys "aaaakey*" | xargs redis-cli -h host -p port -a password -n 4 del

        -a secret key

        -n Specify which db library

 

 

 

 

 

 

原网站

版权声明
本文为[Why is utopia occupied]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111204583550.html