随笔分类 -  redis

摘要:Misc rehash 是分 db 的 redis db 中的 字典什么情况下会自动 rehash? redis 中的 key 淘汰, 定时被动淘汰(有2 种模式)。 另外则是每次访问到 key 都会检查一下 key 是否过期则删除(也能减少部分 key) key 的读写分多套接口,基本上读写的功能 阅读全文
posted @ 2020-06-15 14:48 tmortred 阅读(229) 评论(0) 推荐(0)
摘要:Intro redis 号称是高性能的字典服务。redis 的底层常用的数据结构 (intset,skiplist 等大量使用二分查找技术)。 现在想看一下 二分查找到底有多块 code #include <stdio.h> int binarySearch(int arr[], int l, in 阅读全文
posted @ 2020-06-15 10:52 tmortred 阅读(136) 评论(0) 推荐(0)
摘要:descption We have a sorted set of digits D, a non-empty subset of {'1','2','3','4','5','6','7','8','9'}. (Note that '0' is not included.) Now, we writ 阅读全文
posted @ 2020-06-13 16:40 tmortred 阅读(147) 评论(0) 推荐(0)
摘要:Misc /* Resize */ for (j = 0; j < dbs_per_call; j++) { tryResizeHashTables(resize_db % server.dbnum); resize_db++; } /* Rehash */ if (server.activereh 阅读全文
posted @ 2020-05-26 23:37 tmortred 阅读(164) 评论(0) 推荐(0)