dongsi5381 2014-03-12 14:03
浏览 563
已采纳

redis-server每5分钟崩溃一次

I am setting a hash entry using phpredis which is pulling data from mysql; since i am migrating some data from my MySQL database to redis for faster access, since the amount of data/changes i am making in redis is large(4 GB), it is crashing after every 5-10 mins(variable).

the log says:

[4464] 12 Mar 12:20:04 # Background saving terminated by signal 9
[4464] 12 Mar 12:20:04 * 10 changes in 300 seconds. Saving...
[4464] 12 Mar 12:20:05 * Background saving started by pid 9212
[4464] 12 Mar 12:20:05 # Background saving terminated by signal 9
[4464] 12 Mar 12:20:05 * 10 changes in 300 seconds. Saving...
[4464] 12 Mar 12:20:06 * Background saving started by pid 9214
[4464] 12 Mar 12:20:07 # Background saving terminated by signal 9
[4464] 12 Mar 12:20:07 * 10 changes in 300 seconds. Saving...
[10975] 12 Mar 12:43:13 * Server started, Redis version 2.2.12

Which makes me restart redis again and again, which very painfull i have already set vm.overcommit to 1.

I am using AWS ec2 small instance with RAM 1.6 GB on Ubuntu 12.04 LTS.

Please advice me some smart solution.

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dsa122870 2014-03-13 02:27
    关注

    4GB with only 1.6GB available? Or are you only talking about throughput? You should always stay below the physical memory limit. Redis is not designed for virtual memory (well, the support for virtual memory redis once had is deprecated and removed). You can set the limit (I advise 95% of the physical memory) in redis.conf.

    Maybe this helps: shutting off background saving

    Also, keep in mind that redis handles backups in a safe way. If you have 4GB in memory, and a rdb file of 4GB, it writes a new backup first, and removes the old one afterwards. AOF backups behave a bit differently: append-only.

    Kind regards, TW

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 Arcgis相交分析无法绘制一个或多个图形