Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

Add Garbage Collector #25

Open
Open

Description

@qbolec

I see that you've invested a lot of time in stackable Eviction Strategies.
That's good for me, because that means, that you've already made the first step : admitted that the default LRU is not as good as it could.

Perhaps you would like to incorporate this changeset:
https://groups.google.com/forum/?fromgroups#!topic/memcached/MdNPv0oxhO8
which makes sure that expired items are never in memory, and does so in O(1).
We use it in nk.pl since years at it works great (evictions dropped to 0, and monitoring memory consumption provides more information now -- also, slabs now have a chance to become emptied and disposed).

The only drawback I can see with it is the additional O(1) memory per item for doubly linked list pointers. I believe that Twitter hires some tough hackers which could make this number smaller (how about the trick with XORed pointers?).

Activity

  1. thinkingfish commented on Apr 6, 2013

    @thinkingfish

    We have given garbage collection some serious thoughts and I agree with you on the benefits it could bring. What stopped us from simply incorporate something similar already was the memory overhead, which is noticeable for smaller items.

    I feel quite a few things could be done to make memory management better, unfortunately I have to shelf the development on Twemcache (other than bug fixes) due to lack of resources. Hopefully I can come back to this in the summer (Q3) and do an in-depth summary and planning about the memory management module as a whole.

  2. qbolec commented on Apr 7, 2013

    @qbolec
    Author

    Cool, please let me know if I could help somehow in the process.

  3. thinkingfish commented on Jun 2, 2013

    @thinkingfish

    I think the better approach, as Jamie suggested in the thread, is to use a background, latency oblivious thread to do the clean-ups. If you want to extend the current threading architecture of Twemcache, which uses background threads for various tasks, I'll be happy to review it and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions