0

I've installed memcache (with the memcache PHP extension).

I have a database with 100 000 records (random).

When I select all of them, and when I try to store the output in memcache, it's not working. When I select just 1000, it's working (without changing the code, except: 'LIMIT 100000' to 'LIMIT 1000' in my SQL-query).

Does anyone has any idea what's the problem?

Sam Leurs
  • 480
  • 4
  • 20

1 Answers1

5

memcached has a (configurable) limit to how much memory it will use. Here is a list of the configuration parameters you can use with memcached.

I assume when you have that many rows, you're hitting the limit in memcached, so it begins purging the oldest entries. However, "it's not working" is not very specific, so there could be a whole array of things wrong.

bhamby
  • 15,112
  • 1
  • 45
  • 66
  • 1
    Memcached also has a 1 MB limit on value size so if your query is larger than 1MB you will get an error too. – mikewied Jan 19 '12 at 19:11