当前位置:网站首页>Redis学习笔记-3.慢查询和其他高级数据结构
Redis学习笔记-3.慢查询和其他高级数据结构
2022-07-31 11:13:00 【天生我才~~】
总览
1. 慢查询
1. 生命周期
2. 两个配置
队列长度
- 队列的固定长度配置
慢查询阀值
- 时间超过此阀值,就进行队列等待进行慢查询
3. 配置方法
4. 慢查询相关命令
5. 运维经验
- 1.QPS通常在万级别,即,每处理一个请求一般在0.1ms左右,如果设置阀值过大,如10ms,会对QPS有影响
- 2.队列长度不要设置过小,储存于内存,不利于历史查看
- 3.理解生命周期,知道性能瓶颈在什么位置
- 4.定期持久化到其他数据库,例如MySQL,以便于对历史记录的查询
2. pipeline
2.1 pipeline流水线作用
2.2 客户端使用
2.3 与原生M操作的对比
原生M操作是原子操作
pipeline非原子操作
- 执行时,将流水线的任务拆分处理,不具有原子性
- 单返回时,按照顺序去取
2.4 使用建议
3. 发布订阅功能
3.1 角色
3.2 通讯模型
注意:redis无法做消息的堆积
,即,新的订阅者是无法订阅到发布者之前的消息
3.3 API
publish
subscibe
unsubcribe
其他功能
3.4 消息队列
- 与发布订阅不同,发布订阅,所有订阅者都能获取资源,但消息队列不同,只有一个订阅者能抢到消息
- redis没有实现此功能的api,只是用list阻塞拉取来模拟此功能的实现
- 根据业务场景使用不同,选择不同的功能
4. bitmap数据结构
4.1 位图认识
- 即redis可以直接操作一个位
4.2 相关API
setbit
- 偏移量从
0
开始计算 - 返回之前位置的数,
0或1
,默认是0
- 因偏移量默认会补
0
, 故,注意不要在一个很短的位图上,突然设置一个大的偏移量,否则会出现一些性能上的问题,因为redis是单线程的
getbit
bitcount
bitop
bitops
4.3 独立用户统计
5. HyperLogLog
5.1 认识
5.2 相关API
5.3 局限性和使用经验
- 不能取出单条数据
6. GEO
6.1 GEO是什么
6.2 常见API
geoadd
geopos
geodist
georedius
边栏推荐
猜你喜欢
[ 图 论 ]二分图判定及其匹配(基础+提高)
台达PLC出现通信错误或通信超时或下载时提示机种不符的解决办法总结
数据持久化技术——MP
After class, watching the documentation and walking back to the lab, I picked up the forgotten SQL operators again
Usage of exists in sql
【虚拟化生态平台】平台架构图&思路和实现细节
Summary of several defragmentation schemes for MySQL (to solve the problem of not releasing space after deleting a large amount of data)
IDEA configure method annotation automatic parameters
最新MySql安装教学,非常详细
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ
随机推荐
xmind使用指南(XMind具有下列哪些功能)
unity-shader-2
PyQt5快速开发与实战 9.5 PyQtGraph在PyQt中的应用 && 9.6 Plotly在PyQt中的应用
「MySQL」- 基础增删改查
SQL - Left join, Right join, Inner join
线程池 ThreadPoolExecutor 详解
A Method for Ensuring Data Consistency of Multi-Party Subsystems
Summary of several defragmentation schemes for MySQL (to solve the problem of not releasing space after deleting a large amount of data)
pycharm汉化教程(碧蓝幻想汉化插件安装)
Docker搭建Mysql主从复制
Android studio connects to MySQL and completes simple login and registration functions
Usage of JOIN in MySQL
MySQL limit paging query and performance issues
Redis缓冲穿透和缓冲击穿工具类的封装
Intranet Penetration Learning (IV) Domain Lateral Movement - SMB and WMI Service Utilization
redis-enterprise use
Windows安装mysql详细步骤(通俗易懂,简单上手)
Three ways of single sign-on
Windows系统Mysql8版本的安装教程
musl Reference Manual