Hey,
I'll answer these inline, but up front: Are you having a specific problem
you're tracking down, or is this just out of curiosity?
None of these are things you should waste time thinking about. Memcached
handles it internally.
> 1.
>
> I setup memcache with 55gb, however total_malloced from stats slabs says only 41657393216, will that grow as the data grows?
Yes. Memory is lazily allocated, one megabyte at a time.
> 2.
>
> How many pages are allocated per slab? Is that dynamic or is there a limit?
It's dynamic. If you have a new enough version (> 1.5) they are also
rebalanced automatically as necessary.
> 3.
>
> We use not more than 5-6 slabs, and our largest slab is 300 byte, are there best practices to limit the object size to 301, so that slab allocation
> logic is simplified
You can probably ignore this, unless you feel like there's a significant
memory waste going on. You can change the slab growth factor (-f) to
create more classes in the lower numbers than higher numbers but again I
wouldn't bother unless you really need to.
It doesn't "simplify" the logic either way.
-Dormando