首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >redis服务器使用高cpu。

redis服务器使用高cpu。
EN

Stack Overflow用户
提问于 2019-04-23 17:28:31
回答 1查看 991关注 0票数 0

我继承了一个自定义构建的网页,它使用redis服务器,我注意到,每3-5分钟,redis服务器就会达到峰值,并且使用100%的cpu,时间可能是2-3分钟。

有人知道我能做些什么来优化这个问题吗?

代码语言:javascript
复制
Log file:
2276:M 23 Apr 2019 18:22:44.060 * 10 changes in 300 seconds. Saving...
2276:M 23 Apr 2019 18:22:44.356 * Background saving started by pid 16081
16081:C 23 Apr 2019 18:25:03.575 * DB saved on disk
16081:C 23 Apr 2019 18:25:03.783 * RDB: 1 MB of memory used by copy-on-write
2276:M 23 Apr 2019 18:25:04.174 * Background saving terminated with success
2276:M 23 Apr 2019 18:30:05.089 * 10 changes in 300 seconds. Saving...
2276:M 23 Apr 2019 18:30:05.396 * Background saving started by pid 16984
16984:C 23 Apr 2019 18:32:26.841 * DB saved on disk
16984:C 23 Apr 2019 18:32:27.126 * RDB: 1 MB of memory used by copy-on-write
2276:M 23 Apr 2019 18:32:27.523 * Background saving terminated with success
2276:M 23 Apr 2019 18:47:28.032 * 1 changes in 900 seconds. Saving...
2276:M 23 Apr 2019 18:47:28.334 * Background saving started by pid 18748
18748:C 23 Apr 2019 18:49:53.540 * DB saved on disk
18748:C 23 Apr 2019 18:49:53.744 * RDB: 1 MB of memory used by copy-on-write
2276:M 23 Apr 2019 18:49:54.157 * Background saving terminated with success
2276:M 23 Apr 2019 18:54:55.023 * 10 changes in 300 seconds. Saving...
2276:M 23 Apr 2019 18:54:55.328 * Background saving started by pid 19422
19422:C 23 Apr 2019 18:57:18.455 * DB saved on disk
19422:C 23 Apr 2019 18:57:18.592 * RDB: 1 MB of memory used by copy-on-write
2276:M 23 Apr 2019 18:57:18.823 * Background saving terminated with success
EN

回答 1

Stack Overflow用户

发布于 2019-04-23 20:06:06

雷迪斯就是这样。备份过程涉及到大量的压缩,这将在一段时间内固定一个核。

您可以单独使用AOF (仅追加文件),但这也需要定期的剪枝和压缩,这只是不太频繁和要求较低。

手册有一些细节,包括这个警告:

有许多用户单独使用AOF,但我们不鼓励使用RDB快照,因为经常使用RDB快照是进行数据库备份、更快重新启动以及在AOF引擎中出现bug的好主意。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55816517

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档