Automatic Pool Resizing #58
-
Documentation mentions automatic pool resizing feature is incomplete and untested in prod (ref: https://cachelib.org/docs/Cache_Library_User_Guides/automatic_pool_resizing ). I looked at the code and couldn't get a clear picture of whether this feature is now complete. Is this pool resizing feature still incomplete ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The basic functionality is complete but it is not actively used today. To take advantage of it, you can enable PoolOptimizer worker, and then specify a policy. Today we only support one policy "MarginalHits". You can implement the PoolOptimizePolicy interface yourself and add additional policies towards your goal of resizing. The gist is that the Pool Optimizer will be asking this policy to rank all the pools on a particular metric (user-defined), and it will move a slab from the pool with the lowest score to the one with the highest score, in an attempt to maximize the amount of memory devoted to pools with highest scores. You can enable Pool Optimizer here: https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/CacheAllocatorConfig.h#L238-L246 Pool optimize policy interface: https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/PoolOptimizeStrategy.h#L34-L40 Marginal policy (this is our only optimize policy today. It requires the use of 2Q eviction policy.): https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/MarginalHitsOptimizeStrategy.h#L25-L29 |
Beta Was this translation helpful? Give feedback.
The basic functionality is complete but it is not actively used today. To take advantage of it, you can enable PoolOptimizer worker, and then specify a policy. Today we only support one policy "MarginalHits". You can implement the PoolOptimizePolicy interface yourself and add additional policies towards your goal of resizing.
The gist is that the Pool Optimizer will be asking this policy to rank all the pools on a particular metric (user-defined), and it will move a slab from the pool with the lowest score to the one with the highest score, in an attempt to maximize the amount of memory devoted to pools with highest scores.
You can enable Pool Optimizer here: https://github.com/facebook/C…