Error handling in Cache::Memcached

George Schlossnagle george at omniti.com
Wed Jul 12 19:32:52 UTC 2006


Richard 'toast' Russo wrote:
> I think error conditions map to cache miss by design.  Chances are a
> failure like this is transient, and if your site is completely
> dependent on memcached, you just have to hope your DB (or other slow
> resource) is going to avoid meltdown until your memcached servers
> come back.  Chances are someone is tweaking the server options, and
> it's going to be down for ~ 30 seconds.

I figured it was by design.  Still, it seems highly inconvenient that
there's no way for the application to know if the miss is due to the
data not being present or the server not being present.  Being able to
track server errors from the application has extremely high value,
particularly because the application will probe the server much more
frequently than any monitoring system you might use.

> 
> A patch to have a way to test if there are active servers (if that's
> not already there) would be fine.  Maybe some users are going to be
> able to determine performance will be awful for some features and
> turn them off.

The problem with this is that since I still don't know why my get()
failed, I would need to call this method unconditionally before every
operation.  That's very expensive.  Optionally die()'ing seems much more
perlish.

George


More information about the memcached mailing list