Add function slabs_reclaim() to reclaim free slabs positively

Brad Fitzpatrick brad at danga.com
Wed Sep 6 03:00:28 UTC 2006


Could you send a diff -u between your source and final files?

On Wed, 6 Sep 2006, Henry Lu wrote:

> Hi Brad:
>
> I think the following is the detail :)
>
> /memcached-1.1.12/doc/memory_management.txt
>
> 'In general, if your system starts producing a different pattern of common
> object sizes, the memcached servers will become less efficient, unless
> you restart them. Slabs reassignment, which is the next feature being
> worked on, will ensure the server's ability to reclaim a slab (1Mb of
> memory) from one size  class and put it into another class size, where
> it's needed more.'
>
> For example, when you insert blocks of 8k into memcached,
> and make it full, after a while, a large number of items of 8k expired,
> and some slabs in 8k clsid got free.
> At that time, I am trying to insert a block of 16k, it fails with 'out of
> memory'.
> Actually the free slabs contain items of 8k cannot be moved from 8k clsid to
> 16 clsid.
>
> So I make a 'global_free_slab_list' to contain all free slabs by runing
> 'slabs_reclaim()' every 5 seconds.
>
> Thanks,
> Henry
>
> On 9/6/06, Brad Fitzpatrick <brad at danga.com> wrote:
> >
> > Henry,
> >
> > Major patches for 1.1.x aren't being accepted, as that's the stable
> > branch.  Also, I've never had any problems with what you describe --- I'd
> > need more details on how it fails for you before I'd consider any fix.
> >
> > - Brad
> >
> >
> > On Wed, 6 Sep 2006, Henry Lu wrote:
> >
> > > Hi guys:
> > >
> > > Slab class reassignment is a big problem for memcached of the latest
> > > version(1.1.12).
> > > After working around memcached for weeks, I made a function called
> > > 'slabs_reclaim()' to reclaim free slabs positively.
> > > A free slab meants all items in it are expired.
> > > Then I add 'slabs_reclaim()' to function 'delete_handler()' before
> > return,
> > > so it can be called every 5 seconds.
> > >
> > > Pls check the attachment for 'slabs.c' which I modified.
> > >
> > > Thanks,
> > > Henry
> > >
> >
>


More information about the memcached mailing list