Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[💡 FEATURE REQUEST]: KV. Ability to see memory statistics #1412

Closed
gam6itko opened this issue Jan 11, 2023 · 5 comments · Fixed by roadrunner-server/memory#77
Closed

[💡 FEATURE REQUEST]: KV. Ability to see memory statistics #1412

gam6itko opened this issue Jan 11, 2023 · 5 comments · Fixed by roadrunner-server/memory#77
Assignees
Labels
C-feature-accepted Category: Feature discussed and accepted C-feature-request Category: feature requested, but need to be discussed
Milestone

Comments

@gam6itko
Copy link
Contributor

gam6itko commented Jan 11, 2023

Plugin

KV

I have an idea!

I use KV memory driver via spiral/roadrunner-bridge. It works but I don't know what happens there.

I need a tool to see statistic about

  • memory usage
  • keys count
  • get\set call in time range
  • etc

I suppose it should be some set of RPC methods that can be connected from a birddog or a console command (spiral/roadrunner-bridge)

EDIT:
ref: #1635

@gam6itko gam6itko added the C-feature-request Category: feature requested, but need to be discussed label Jan 11, 2023
@github-project-automation github-project-automation bot moved this to Backlog in General Jan 11, 2023
@rustatian rustatian added this to the v2023.1 milestone Jan 11, 2023
@rustatian
Copy link
Member

rustatian commented Feb 22, 2023

Hey @gam6itko 👋🏻

  • Calculating the memory footprint for the hashmap is not an easy task due to its distributed nature (buckets). I guess that it can be deduced approximately with unsafe.SizeOf(map) + len of the map * 8 + size of the key * 8 (keys in the bucket) + size of the value * 8 (values in the bucket).

  • Keys count and get/set distribution might be added easily to the Stat method. I agree with the keys count, but I don't think the memory driver should have some kind of push per minute (for example) stat (use cases?).

  • etc ?

@gam6itko
Copy link
Contributor Author

gam6itko commented Feb 23, 2023

@rustatian

The main thing that I need is to have info about what is happening in KV.
At least I need couple of things:

  • get total memory usage
  • the number of keys

Actually i don't need profiling things like "request per minute" or else. This was written more as an example.

I understand that the RR is not a Redis and I will be happy with the possible minimum of functionality

@rustatian
Copy link
Member

Nice 👍🏻
Having some statistics about the in-memory plugin is generally a good idea. It would be planned for the 2023.2.0 milestone (June 2023)

@rustatian rustatian modified the milestones: v2023.1.0, v2023.2.0 Feb 23, 2023
@rustatian rustatian moved this from Backlog to Todo in General Feb 23, 2023
@rustatian rustatian added the C-feature-accepted Category: Feature discussed and accepted label Feb 23, 2023
@rustatian
Copy link
Member

I found a way to calculate a memory consumption (that's not so trivial, since we have to calculate the data size, not the pointers size) of the in-memory driver.

@rustatian
Copy link
Member

Moving to the 2023.3 release since we don't have any RPC in the KV plugin to check the memory consuption/keys count or other statistic from the driver.
At first, need to create a general RPC in the KV plugin to obtain info from the underlying drivers. Then it would be possible to attach the memory plugin and see statistic from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-accepted Category: Feature discussed and accepted C-feature-request Category: feature requested, but need to be discussed
Projects
Status: ✅ Done
Status: SPRINT-21AUG-18SEP
Development

Successfully merging a pull request may close this issue.

2 participants