set_multi() and delete_multi()
sgrimm at facebook.com
Mon Mar 12 18:33:07 UTC 2007
Not on the server side, no. (I can't speak for the client side; I'm not
the one working on that here.) We rarely do large batch deletes or sets,
so the meager CPU savings wouldn't be worth the engineering time for us.
Michael Monashev wrote:
> Hi Steven,
> Do you plan to implement set_multi() and delete_multi() in the future?
> SG> The server-side CPU cost of processing a two-key get request is MUCH
> SG> lower than processing two single-key requests because you only have to
> SG> run through the parser and (usually) the libevent code once. Don't
> SG> remember the exact ratio off the top of my head but it's pretty steep,
> SG> something in the neighborhood of a 10-key get request taking only 2x the
> SG> CPU time of a 1-key request.
> SG> This would be less of an issue with a well-designed binary wire protocol
> SG> that didn't require any parsing at all (though you'd still see some
> SG> difference due to having to wake up for input on each request), but
> SG> right now you can save significant amounts of CPU time on the memcached
> SG> server by bundling your gets up into as few requests as possible. So I'm
> SG> glad multi-gets aren't just a series of streamed single-gets.
More information about the memcached