Skip to content

Conversation

@bitfaster
Copy link
Owner

Fix cycle logic so that if all items are touched when a new item is added (thus the coldest is cycled back into warm) we simply discard the coldest cache item (last item in cold queue).

@bitfaster bitfaster marked this pull request as ready for review August 17, 2023 21:41
@bitfaster
Copy link
Owner Author

bitfaster commented Aug 17, 2023

Hit rate tests

In summary, better in 2 scenarios, worse in 2 scenarios and equal in 1 scenario. Arc OLTP with a cache size of 250 is the only test with a significant degradation.

Wikibench (better)

CacheSize Before After
25 30.75 32.40881000373165
50 38.54 39.54920682561558
75 42.52 43.51437745987301
100 45.1 46.151614417006265
125 47.22 48.18985790615074
150 48.69 49.614582684121785
175 49.93 50.743290409091635
200 50.83 51.62156813535368

Glimpse (unchanged)

CacheSize Before After
250 12.83 12.834580216126351
500 26.13 26.134663341645886
750 39.43 39.43474646716542
1000 43.28 43.275145469659186
1250 49.93 49.925187032418954
1500 52.4 52.40232751454697
1750 53.5 53.49958437240233
2000 53.55 53.54945968412302

Arc OLTP (worse)

CacheSize Before After
250 15.6 11.649792975950204
500 27.12 23.37747293919455
750 32.29 30.91796159252635
1000 36.01 35.13096937575549
1250 38.68 38.00370838324336
1500 40.69 40.19668652128492
1750 42.48 41.81120063009698
2000 44.16 43.32496485787266

Arc Search (very slightly worse)

CacheSize Before After
100000 9.63 9.326894162265988
200000 18.70 18.400852233908196
300000 26.83 26.678927981505275
400000 34.39 34.381865297163486
500000 41.43 41.726245393779095
600000 48.26 48.69219345890119
700000 54.61 55.08680008937266
800000 61.3 60.86261196113873

Arc Database (better)

CacheSize Before After
1000000 11.9 12.06719261894623
2000000 23.24 23.552243326784346
3000000 36.19 37.093629538181446
4000000 39.60 39.630505256620765
5000000 45.15 45.32610117487987
6000000 50.37 50.626977763792084
7000000 56.08 56.47311945854041
8000000 61.0 61.15599094556252

@coveralls
Copy link

coveralls commented Aug 17, 2023

Coverage Status

coverage: 96.342% (+0.1%) from 96.219% when pulling 8445b79 on users/alexpeck/unbounded2 into 5565e86 on main.

@bitfaster
Copy link
Owner Author

bitfaster commented Aug 17, 2023

With cold/warm reversed in the cycle method, the throughput test (multi-threaded) results in some runaway growth.

@bitfaster bitfaster merged commit b21ff05 into main Aug 18, 2023
@bitfaster bitfaster deleted the users/alexpeck/unbounded2 branch August 18, 2023 01:13
@bitfaster bitfaster mentioned this pull request Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cold queue increases infinitely for some partitions and cache sizes

3 participants