当前位置:网站首页>Redis设计规范
Redis设计规范
2022-07-28 09:54:00 【华为云】
Key的设计规范

Java对象存储方案

Redis安全建议
Redis不要被外网访问,禁止bind 0.0.0.0 应当设置为bind 192.168.132.128
更改redis的默认端口不要6379,可以设置成其他的如 -port 6677
Redis使用非Root启动,不要用root,可以为redis创建一个专门的账户为redis进行管理。
Redis要设置密码(登陆密码和主从同步的密码,密码建议大小写字母和字符混用,提高安全性能),不要于登陆密码相同
定期备份 save/bgsave命令 进行RDB备份
配置好Linux防火墙规则,放行最小范围的端口
Redis内存占用评估
占用内存分为:自身内存,缓冲内存,对象内存
自身内存
redis进程用于运行和维护开辟的一段空间内存。
缓冲内存
客户端缓冲区:如客户端输入的命令是存储在服务器上的客户端缓冲区内。
复制缓冲区:redis会开辟一块内存用于交换数据,提高数据的交换的速度。
AOF缓冲区:用于AOF日志,因为AOF不是一条命令就写写一次到AOF日志文件,而是先存储到AOF缓冲区,到达一定的量,一起写到日志文件中。
对象内存
实际存储数据的区域。
Redis内存统计

Redis设置内存上限

Redis内存回收策略
volatile-lru:在即将过期的数据中删除最近最少使用的key
volatile-lfu:在即将过期的数据中删除最少使用频率的key
volatile-ttl:按时间顺序,删除即将过期的key
volatile-random:在即将过期的数据中随机删除key
allkeys-lru: 在所有数据中删除最近最少使用的key
allkeys-lfu: 在所有数据中删除最少使用频率的key
allkeys-random: 在所有数据中随机删除key
noeviction: 永不过期,如果有添加的请求,则返回错误
边栏推荐
- ES6新特性
- 今天和大家聊一聊mysql数据库的数据类型
- Arthas tutorial
- The victory of Dao community, tiger Dao VC wins in governance and consensus
- PHP 常用的数组整理
- PHP7 中 ?? 与? :的区别
- In retaliation for the dismissal of the company, I changed all code comments of the project!
- MySQL 为什么有时候会选错索引?
- 【MySQL】查询多个ID返回字符串拼接
- Irregular area of OSPF, LSA and serial number
猜你喜欢

LSA and optimization of OSPF

The high temperature continues, and public transport enterprises carry out special safety training
![[ESP32][esp-idf] esp32s3快速搭建LVGLV7.9](/img/39/8efef047d0a9223b97819a54b5edf8.png)
[ESP32][esp-idf] esp32s3快速搭建LVGLV7.9

2022-uni-app解析token标准的方式-使用jsrsasign-爬坑过了

Being on duty less than 8 hours a day and being dismissed? Tencent's former employees recovered 13million overtime pay, etc., and the court won a compensation of 90000 in the final judgment

Read Plato farm's eplato and the reason for its high premium

并查集

【学习笔记】border与period
![[esp32][esp idf] ap+sta realizes wireless bridging and transferring WiFi signals](/img/bf/0a968064a8f7c11b86a2a2820208e6.png)
[esp32][esp idf] ap+sta realizes wireless bridging and transferring WiFi signals

极致通缩和永动机模型,将推动 PlatoFarm 爆发
随机推荐
Tencent technical experts: decrypt the 100 million user products wechat, QQ, King glory... Comprehensively practice on the cloud!
Extreme deflation and perpetual motion machine model will promote the outbreak of platofarm
SQL Server、MySQL主从搭建,EF Core读写分离代码实现
SQL server, MySQL master-slave construction, EF core read-write separation code implementation
Introduction to timebasedrollingpolicy
深度学习必懂的 13 种概率分布
Data can't lie. Plato farm is the leader of the meta universe
Array collation commonly used in PHP
这种动态规划你见过吗——状态机动态规划之股票问题(中)
Plato Farm-以柏拉图为目标的农场元宇宙游戏
第四步-用户开发环境设置
Introduction to consoleappender
Flink - checkpoint Failure reason: Not all required tasks are currently running
PHP 常用的数组整理
PHP Basics
New features of ES6
Introduction to thresholdfilter
【MySQL】查询多个ID返回字符串拼接
02.1.2.逻辑类型 bool
redis的基础知识