vmware / splinterdb

High Performance Embedded Key-Value Store
https://splinterdb.org
Apache License 2.0
682 stars 57 forks source link

Failed to get cache page because low cache capacity #608

Closed XiangpengHao closed 8 months ago

XiangpengHao commented 8 months ago

Hi, I run into an assertion error while trying to get free page:

Assertion failed at src/clockcache.c:1670:clockcache_get_free_page(): "0"

It seems related to that the cache capacity is running low. Related: https://github.com/vmware/splinterdb/issues/308

I'm confused about the minimal cache size. Do we require all inserts to fit in cache?

rtjohnso commented 8 months ago

The minimal cache size is roughly 128MiB, assuming the default config. The cache must be large enough to hold all the memtables. In the default config, there are 4 memtables, each with a max size of 24 MiB, for an absolute minimum cache size of 96MiB. However, I would recommend keeping it at least at 128MiB, just as a safety and performance margin.

Note that we also recommend using splinter in O_DIRECT mode, which means that it doesn't use the OS page cache. In that case, for performance, we recommend that you make the splinter cache as large as you can (while still fitting in RAM).

XiangpengHao commented 8 months ago

Thanks for the detailed explanation! I'm closing this issue as it no longer occurs.