ADT features in memcached?

Iain Bapty ibapty+memcached at gmail.com
Wed Jun 13 13:21:06 UTC 2007


I like this idea.

I'm using Memcache as a queue in exactly this way but am having to
retrieve my entire queue class to add an item. When the class instance
hits around 400kB (serialized) it starts to become a bit of a CPU hog
to save to Memcache on my test system.

I've also encountered an issue where the maximum size of a class
instance I can save is 1024kB. Any higher and this corrupts the PHP
interface to memcached and I need to restart my PHP apps to recover.
The feature suggestion sounds like it might be able to workaround that
kind of issue.

On 5/30/07, howard chen <howachen at gmail.com> wrote:
> I know memcached don't have this featre right now, but i think it is
> interesting?
>
> e.g. (PHP) - List
>
> $arr = array (1,2,3);
>
> memcache_obj->set($key, $arr);
>
> memcache_obj->push($key, $arr, 4);
> memcache_obj->push($key, $arr, 5);
> memcache_obj->pop($key, $arr);
>
> print_r(memcache_obj->get($key, $arr)); // return 1,2,3,4
>
> using similar way, we can also think abt implement queue, stack,
> btree, heap, etc
>
> you might ask: why implement those things?
>
> in example situation: sometimes we need to retrieve the whole array
> from memcached, append it using PHP, and save it back to memcachd. if
> we have push() method, we can save a lot of I/O
>
> any comments?
>


More information about the memcached mailing list