facebook / CacheLib

Pluggable in-process caching engine to build and scale high performance services

Home Page:https://www.cachelib.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the max DRAM cache size 256GB? And how to make it larger?

sunnyszy opened this issue · comments

Hi,

I'm working on a cache configuration project, and I would like to configure CacheLib with ~700GiB of DRAM.

  • I believe the current code has a max DRAM size limitation. The fixed 4MB slab and the max number of slabs (I believe is 65535) make the max DRAM size 256GB. Is there true?
  • If so, is there any easy way you can recommend to lift this limit?

It is true that the maximum DRAM size of cachelib supported is 256GB. Explained https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/memory/CompressedPtr.h#L35.

What's your workload like? One way is to create multiple cachelibs and have each of them handle different allocation sizes.

We want to use 32 bits to address every allocation in the slab space with the smallest addressible allocation being 64 bytes, we have 256GB. If you want to address more than this, you can make the smallest addressible allocation larger by changing https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/memory/Slab.h#L81.

But I think creating multiple cachelibs may be easier.

Thanks for the quick response!

My workload is a video streaming request trace. Each object is pretty large (~MB), so it is easier for me to increase the smallest addressable allocation.