2

I like redis because it lets me do operations on data structures. I wanted to see what would happen if i were to put more data into redis then i have for ram. So i wrote a loop that inserted 30k bytes repeatedly and set maxmemory 100MB. I figure it would stay at 100mb. It kept growing. Past 1gb then past 2gb. Suddenly it crashed because i ran the 32bit version.

Now... i dont understand what the point of maxmemory is? I am using the windows version so maybe its ignored. Does redis have to have everything in memory? If i have a site (on linux) with a 10gb database and 512mb on the machine will redis work? I don't need it to be amazingly fast i just prefer to modify data in it then sql (although i hope it is still faster then mysql)

2 Answers2

2

Redis is an in-memory database, you are probably better off looking at something designed to be "on disk", though there are some really nice aspects of redis I have struggled to find elsewhere :(

Tom Newton
  • 4,141
  • 2
  • 24
  • 28
1

The point of maxmemory is to set the maximum amount of memory Redis will use. However, you've put it in an impossible situation, asking it to store more information than can possibly fit in the memory allotted. If you give Redis some way to free memory, it will. But if no objects are discardable, there's nothing it can do.

"Note that the [maxmemory] setting is really only a good idea when using Redis as a cache. If you are using it as a general database, you will need to monitor its memory consumption and take action before too many resources are consumed."

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
  • blah, right now i'm thinking exactly what tom newton (other answer) said. –  Sep 03 '12 at 21:24