obukhov / redis-inventory

CLI tool to see redis memory usage by keys in hierarchical way. Think of disk inventory but for redis.
MIT License
231 stars 29 forks source link

General usability questions #35

Closed dsoprea closed 2 years ago

dsoprea commented 2 years ago
  1. The Medium article mentions being able to precache the index and using that for the inventory instead of hitting the DB directly for however many inventory analyses you wish to run. How is this done in the context of Docker? Neither the Dockerfile nor the docker-compose config seems to have a concept of volumes, which could then be bind-mounted to the host system in order to capture and/or provide data for the inventory command.

  2. It's unclear how the index data/file should be provided to the inventory command. It's not mentioned on the Github or the Medium article, and the inventory command doesn't seem to take any relevant parameters for it.

  3. Just to clarify, this tool won't automatically enumerate all of the DB slots automatically, right? We need to call it N times if we want to evaluate N different concurrent DBs in the same instance?

obukhov commented 2 years ago

Hello, @dsoprea thanks for your questions. I tried to answer them below:

  1. The Medium article mentions being able to precache the index and using that for the inventory instead of hitting the DB directly for however many inventory analyses you wish to run. How is this done in the context of Docker?

Check the documentation here

It suggests mounting the current directory as /tmp where the "index" file is saved. Maybe there are better options if you have something in mind please, suggest.

  1. It's unclear how the index data/file should be provided to the inventory command. It's not mentioned on the Github or the Medium article, and the inventory command doesn't seem to take any relevant parameters for it.

Currently, there is only one index file saved to /tmp folder with "index" command, after that, you can run multiple "display" commands using this index. There is no way to customize the index file name currently and save/pass different files to the tool. You can achieve that by renaming files in your mounted folder though. Keep in mind "inventory" command always does both indexing and displaying (but doesn't save the index file to disk).

  1. Just to clarify, this tool won't automatically enumerate all of the DB slots automatically, right?

Yes, that's right. As database usage is kind of discouraged by redis maintainers. But if you would like to contribute making "--all-dbs" option possible it will definitely be welcomed.