redis如何持久化数据库

951
2021/2/1 12:36:38
栏目: 云计算
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

redis如何持久化数据库

redis持久化数据库的方法:

快照的方式持久化到磁盘,配置代码如下:


save 900 1

save 300 10

save 60 10000



上面的配置规则意思如下:


# In the example below the behaviour will be to save:

# after 900 sec (15 min) if at least 1 key changed

# after 300 sec (5 min) if at least 10 keys changed

# after 60 sec if at least 10000 keys changed



辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: wordpress建立数据库连接时出错如何解决