intel / CacheLib

Pluggable in-process caching engine to build and scale high performance services
https://www.cachelib.org
Apache License 2.0
17 stars 4 forks source link

Improvements to the background workers #96

Closed byrnedj closed 6 months ago

byrnedj commented 1 year ago

The main improvements are:

  1. bulk add/remove from mmContainer
  2. bulk eviction
  3. better scheduling of background threads and calculating batch sizes
  4. improved stats (including those from https://github.com/guptask/CacheLib/tree/dsa_bgknd_bulk_evictions)
  5. ability for background workers to evict/promote without mark moving bit - we can use acquire instead

The results are - nearly 20% improvement in multi-tier (develop branch) performance with this config: simple_tiers_test_bg.txt


This change is Reviewable

igchor commented 11 months ago

@byrnedj could you please split the changes logically into commits (and remove commits with fixes after review, etc.)? I would prefer not to squash all of them on merge, so that it's easier to upstream it.

Also, would it be possible to share the implementation of findEvictionBatch with findEviction? Or should we consider that after merging this and rebasing (since there are some change in upstream I think).

byrnedj commented 7 months ago

@byrnedj could you please split the changes logically into commits (and remove commits with fixes after review, etc.)? I would prefer not to squash all of them on merge, so that it's easier to upstream it.

Also, would it be possible to share the implementation of findEvictionBatch with findEviction? Or should we consider that after merging this and rebasing (since there are some change in upstream I think).

I have done so. Once the rebase is finished I will rebase this branch and we can merge it.

igchor commented 7 months ago

@byrnedj could you please split the changes logically into commits (and remove commits with fixes after review, etc.)? I would prefer not to squash all of them on merge, so that it's easier to upstream it. Also, would it be possible to share the implementation of findEvictionBatch with findEviction? Or should we consider that after merging this and rebasing (since there are some change in upstream I think).

I have done so. Once the rebase is finished I will rebase this branch and we can merge it.

Sounds good. Regarding sharing the implementation - we can probably do it later, there might be some refactoring needed anyway or some comments from meta.