Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background movers implementation #352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

byrnedj
Copy link
Contributor

@byrnedj byrnedj commented Nov 19, 2024

This is the implementation logic for the background eviction (and promotion when multi-tier is enabled).

We benchmarked the background evictors against the current upstream branch with the following configurations using the kvcache workload and the trace replayer. Throughput was kept constant - 1.2M ops/sec using DRAM-only 40GB cache size with ampFactor set to 200. The config files are attached.

The main parameters for the background workers are the number of threads, backgroundMoverThreads and the batch size used backgroundEvictionBatch, which configures the number of items to evict in batch (while holding the container lock), and backgroundTargetFree which sets target free percentage of each class. The background workers will work to keep that percentage of space free.

The main result is that SET (allocate) latencies are significantly reduced.

image

Percentile % Improvement
0.50000 70.4
0.90000 23.0
0.99000 12.2
0.99900 89.7
0.99990 24.9
0.99999 0.6

The GET (find) latencies are unaffected by the background workers as long as the batch size remains reasonably small (10 is the default).
image

baseline.json
bg-eviction.json

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 19, 2024
This is the implementation logic for the background eviction (and promotion when multi-tier is enabled).

The main parameters for the background workers are the number of threads, `backgroundMoverThreads` and the batch size used `backgroundEvictionBatch`, which configures the number of items to evict in batch (while holding the container lock), and `backgroundTargetFree` which sets target free percentage of each class. The background workers will work to keep that percentage of space free.

The main result is that SET (allocate) latencies are significantly reduced - kvcache workload with 40GB DRAM, ampFactor set to 200 via the trace replayer. Throughput set at 1.2M ops/sec.
| Percentile | % Improvement |
|------------|---------------|
| 0.50000    |     70.4      |
| 0.90000    |     23.0      |
| 0.99000    |     12.2      |
| 0.99900    |     89.7      |
| 0.99990    |     24.9      |
| 0.99999    |     0.6       |

The GET (find) latencies are unaffected by the background workers as long as the batch size remains reasonably small (10 in our tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants