Does key length require storage?

Anatoly Vorobey mellon at pobox.com
Mon Jan 24 16:33:11 PST 2005


On Mon, Jan 24, 2005 at 04:08:52PM -0800, Kevin A. Burton wrote:
> Oh ... wow... the class size is dependent on both the key AND the data? 

In the current storage model, yes, but that's not guaranteed to remain
unchanged and should not be relied upon.

In the current storage model, the server takes a (-n almost) fixed-size 
header, concatenates it with the key and the data, and uses the 
resulting chunk of memory as one item to be size-classed and stored.

> If so then does it really make much sense to have a 2^3 size class?

No, there are never any actual items in that class in practice, and 
same goes for 2^4; however, all they take up is just one tiny 
preallocated struct per each, so it's not really a problem.

-- 
avva
"There's nothing simply good, nor ill alone" -- John Donne



More information about the memcached mailing list