English 中文(简体)
enyim and memcached : NOT_STORED errors
原标题:
  • 时间:2009-11-12 22:16:34
  •  标签:
  • memcached

We are using memcached 1.2.4 via enyim and are finding it difficult to get some objects to cache. If I watch the memcache console it just says NOT_STORED .

I think we need to use [serializable] but that doesnt always work. I cant find any documentation or relevant google hits.

Any one here got any clues?

Thanks

最佳回答

Thanks and sorry for the late reply.

The problem was two-fold. Using [Serializable] was not adequate for some objects so we have to implement ISerializable. We were also using ADD rather than SET.

From memory I couldn t find an upgrade for memcached and once we fixed the above it worked.

Cheers

问题回答

Strongly recommend upgraded your version of memcached.

NOT_STORED means just that, your data was not stored. If you are using the add command to store data, this means that there s already data under that key. If you are using replace it means that there s not data under that key. You probably mea set.

I had this problem to...I was running something like:

var = CACHE.fetch("key_name",1.day,true) do
  ModelName.find_by_id(id)
end

So I was having active record find a record for me but I didn t know that memcached doesn t store nil values. What was happening was active record was returning nil because it couldn t find the record and therefore I was telling memcache to store a nil value. The fix was simply this:

var = CACHE.fetch("key_name",1.day,true) do
  ModelName.find_by_id(id) || ""
end

I use Ruby to code with. Hope this helps.





相关问题
Memcached Writes Extremely Slow

I m running memcached on ec2 instances and in some cases am seeing extremely slow writes (10s) for small amounts of data. I m using memcache-client from rails on the client side. Has anyone seen ...

can t install memcache php module

i m trying to install memcache module from http://pecl.php.net/package/memcache. Im using xampp in ubuntu (lampp) with php 5.3. After download the extension, I run phpize, make and make install, then ...

sphinx is returning stale results

Environment: Memcached, Rails 2.2.2 + cache_money, Sphinx + thinking sphinx The following yields stale results: - add a record; mysql contains the correct data - the record is probably cached in ...

Pylons and Memcached

Anyone happen to use this combination in their web application? I m having a bit of trouble finding some sort of tutorial or guideline for configuring this. Also seeing as how I started using Pylons ...

Memcached crashing under moderate load

When running memcached, after a few minutes of use it starts throwing the following errors and memcache stops responding. mcm_server_connect_next_avail():2328 I have searched the Google, and it ...

enyim and memcached : NOT_STORED errors

We are using memcached 1.2.4 via enyim and are finding it difficult to get some objects to cache. If I watch the memcache console it just says NOT_STORED . I think we need to use [serializable] but ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

热门标签