speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
900 stars 67 forks source link

Memory Manager: Report to the log per cf / level / block type stats #660

Open udi-speedb opened 1 year ago

udi-speedb commented 1 year ago

The information will be printed to the log according to the stats_dump_period_sec option.

The feature currently only supports the LRU-Cache

udi-speedb commented 11 months ago

@hilikspdb - It seems there is no dedicated cache entry role for compression dictionaries. There is:

  // Compression dictionary building buffer's charge to account for
  // its memory usage
  kCompressionDictionaryBuildingBuffer,

that may be used to charge to cache the memory used to build the block, but that is not the role used when inserting the compression dictionary block into the cache. According to my checks, the role used is CacheEntryRole::kOtherBlock

hilikspdb commented 11 months ago

you can add this ... currently the "metadata block" (which contains the delete range tombstone) and the dictionary are accounted as "others"

On Wed, Oct 11, 2023 at 7:38 PM udi-speedb @.***> wrote:

@hilikspdb https://github.com/hilikspdb - It seems there is no dedicated cache entry role for compression dictionaries. There is:

// Compression dictionary building buffer's charge to account for // its memory usage kCompressionDictionaryBuildingBuffer,

that may be used to charge to cache the memory used to build the block, but that is not the role used when inserting the compression dictionary block into the cache. According to my checks, the role used is CacheEntryRole::kOtherBlock

— Reply to this email directly, view it on GitHub https://github.com/speedb-io/speedb/issues/660#issuecomment-1758083116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKTXGEWJS5FN5XJM3DW573X63DR3ANCNFSM6AAAAAA4JF4KZQ . You are receiving this because you were mentioned.Message ID: @.***>

udi-speedb commented 11 months ago

you can add this ... currently the "metadata block" (which contains the delete range tombstone) and the dictionary are accounted as "others" On Wed, Oct 11, 2023 at 7:38 PM udi-speedb @.> wrote: @hilikspdb https://github.com/hilikspdb - It seems there is no dedicated cache entry role for compression dictionaries. There is: // Compression dictionary building buffer's charge to account for // its memory usage kCompressionDictionaryBuildingBuffer, that may be used to charge to cache the memory used to build the block, but that is not the role used when inserting the compression dictionary block into the cache. According to my checks, the role used is CacheEntryRole::kOtherBlock — Reply to this email directly, view it on GitHub <#660 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKTXGEWJS5FN5XJM3DW573X63DR3ANCNFSM6AAAAAA4JF4KZQ . You are receiving this because you were mentioned.Message ID: @.>

@hilikspdb - Do you mean that I should maintain counters for kOtherBlock?

hilikspdb commented 11 months ago

It is counted toward the cache as part of the static pinning under the others. It is always pinned even if there is not enough space..

On Wed, 11 Oct 2023, 20:15 udi-speedb, @.***> wrote:

you can add this ... currently the "metadata block" (which contains the delete range tombstone) and the dictionary are accounted as "others" … <#m3023917537616854293> On Wed, Oct 11, 2023 at 7:38 PM udi-speedb @.> wrote: @hilikspdb https://github.com/hilikspdb https://github.com/hilikspdb https://github.com/hilikspdb - It seems there is no dedicated cache entry role for compression dictionaries. There is: // Compression dictionary building buffer's charge to account for // its memory usage kCompressionDictionaryBuildingBuffer, that may be used to charge to cache the memory used to build the block, but that is not the role used when inserting the compression dictionary block into the cache. According to my checks, the role used is CacheEntryRole::kOtherBlock — Reply to this email directly, view it on GitHub <#660 (comment) https://github.com/speedb-io/speedb/issues/660#issuecomment-1758083116>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKTXGEWJS5FN5XJM3DW573X63DR3ANCNFSM6AAAAAA4JF4KZQ https://github.com/notifications/unsubscribe-auth/AZKTXGEWJS5FN5XJM3DW573X63DR3ANCNFSM6AAAAAA4JF4KZQ . You are receiving this because you were mentioned.Message ID: @.>

@hilikspdb https://github.com/hilikspdb - Do you mean that I should maintain counters for kOtherBlock?

— Reply to this email directly, view it on GitHub https://github.com/speedb-io/speedb/issues/660#issuecomment-1758141503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZKTXGHYWECSUN7ASPIX7JLX63H4ZANCNFSM6AAAAAA4JF4KZQ . You are receiving this because you were mentioned.Message ID: @.***>

udi-speedb commented 11 months ago

To sum this up: Compression Dictionary blocks will remain under the kOtherBlock cache entry role and will be reported under that role.