Append + Search Commands

FreeWizard freewizard at gmail.com
Mon May 28 06:30:26 UTC 2007


I guess the SEARCH command might be inefficient here.

On 5/18/07, Filipe Laborde <fil at rezox.com> wrote:
> Hello, this is my first post to this list so let me introduce myself.
>
> We are a Canadian company that uses memcache for our website
> (www.desi-planet.com), and have found the program very useful -- it cut a
> heavy database load down by over 95%.
>
> There was a patch for the append and prefix-flush commands back with version
> 1.1.1, but those versions are gone and this new version did not have these
> functions which I needed. Thus here's a patch to offer these additions:
>
> Commands:
> SEARCH {prefix word}
> APPEND {key} {flags} {expiry} {size}
>
> The search will find all the keys in the memcached server that match the
> prefix. However, some of the returned results will already have expired, so
> it's mainly useful when you will do a delete of those entries or a get of
> them. I use it to delete all message posts with certain prefixes.
>
> The append works like a REPLACE but keeps the previous data and appends the
> new data.
>
> More meta-data with GET command:
> I have included the time-to-expiry information in the GET returns (its the
> first numbe after the key):
> > get bh
> VALUE bh 270 10 20
> 0123456789ABCDABCD..
> END
>
> I use this information for deciding how soon I need to update database
> caches. If I wait till the item has expired, it can cause a massive spike in
> my database as all users wait for the database to get the info. If I know
> it's goign to expire, I can gracefully update it 10-15 seconds before it
> does with new data, and it won't affect users.
>
>
>
>


More information about the memcached mailing list