![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Redis
雨潇先生
Just a coder!
展开
-
Redis实现在线用户列表(按登录时间排序、可查询、踢人)
Redis实现在线用户列表(按登录时间排序、可查询、踢人)前言在日常开发中,我们有时候需要对在线用户进行管理,由于登录信息是可以过期的,那么使用RDBMS存储有点不合时宜,所以NoSQL存储更为合理。网上找了一些资料,但貌似似乎都不太完备,以下为个人理解的Redis实现在线用户列表的方案。方案概述一开始,就需要考虑如何存储、使用什么数据结构。首先string,hash,set可以被排除,因为都无法满足排序问题,现在剩下list和zset,list虽然是有序的,但元素(会话ses...原创 2020-11-30 21:49:28 · 3886 阅读 · 0 评论 -
Redis删除大量key后,占用的系统内存却没有释放?
我们首先来看看官方关于Redis内存管理的说明。原文如下https://redis.io/topics/memory-optimization#memory-allocationMemory allocationTo store user keys, Redis allocates at most as much memory as the setting enables (however there are small extra allocations possible).maxmemory原创 2020-11-13 20:34:32 · 1683 阅读 · 0 评论