Skip to content

Object: Generic cache layer

Furkan Mustafa requested to merge feature/object/cache into master

TODO:

  • Persist write cache at constant pace in background
    • Hurry up in memory pressure (>=75% memory usage of allowed limit)
  • GC Cache
    • Some kind of LRU or Hot-zone tracking can score items in cache. Items with the least importance could be replaced when we need space.
    • Unless space is needed for new items, no need to empty up the cache.

Potential Improvements for later;

  • Instead of using an embedded hashmap, use another object storage backend (eg. MemoryBackend) for volatile storage
  • mem_soft_limit, mem_hard_limit (instead of mem_limit)
  • Block any I/O that would require exceeding mem_hard_limit (or mem_limit)

This MR replaces !14 (closed);

  • Periodically remove items in async fashion from cache
  • |-> persist them in async fashion if not persist yet
  • Watch memory, limit memory usage
    • Over-usage should cause persist&purge-from-memory action

Also, persist/flushes are quite slow, need to figure out an improvement. IDK, maybe parallel invocation (from layer above).

Edited by Furkan Mustafa

Merge request reports