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

Showing stats in a graphical layout via php/apache/ncurses #109

Open
matteotenca opened this issue Jun 25, 2022 · 6 comments
Open

Showing stats in a graphical layout via php/apache/ncurses #109

matteotenca opened this issue Jun 25, 2022 · 6 comments

Comments

@matteotenca
Copy link
Collaborator

Hello,

not an issue, but an idea: use rapiddiskd and (for example) a web server + PHP to show rapiddisk's statistics in a fashonable way. ncurses may be used too, in a command line tool, same idea, different approach.
The objective is to show a real-time graph of the changing stats for a device. But to be honest I don't understand the exact meaning of many of the values - when/if you have time you might explain them to me:

{
  "statistics": [
    {
      "cache_stats": [
        {
          "device": "rc-wa_sda2",
          "reads": 276566,
          "writes": 198611,
          "cache_hits": 13201,
          "replacement": 147282,
          "write_replacement": 0,
          "read_invalidates": 0,
          "write_invalidates": 13572,
          "uncached_reads": 3,
          "uncached_writes": 198611,
          "disk_reads": 263370,
          "disk_writes": 198611,
          "cache_reads": 13201,
          "cache_writes": 263367
        }
      ]
    }
  ]
}

device - no problem
reads - global read operations performed by rapiddisk? What is the unit of measurement of this value?
writes - as above
cache_hits - the number of read operations (?) which did not require disk access?
replacement - no clue
write_replacement - no clue
read_invalidates - no clue
write_invalidates - no clue
uncached_reads - the number of read operations (?) which did not go into the cache?
uncached_writes - as above
disk_reads - the number of read operations (?) which required disk access? Is this equal to reads - cache_hits (or cache_reads)?
disk_writes - same as above? In WA cache writes == disk_writes == uncached_writes ?
cache_reads - no clue
cache_writes - no clue

Thanks in advance!

Regards

@matteotenca matteotenca changed the title Showing stats in a graphical layout via php/apache Showing stats in a graphical layout via php/apache/ncurses Jun 25, 2022
@pkoutoupis
Copy link
Owner

I can document these fields shortly. Remember, the caching code was originally based from Facebook's flashcache-wt: https://github.com/facebookarchive/flashcache/blob/master/doc/flashcache-doc.txt
FYI, it would be neat to have a simple graphical interface.

@pkoutoupis
Copy link
Owner

pkoutoupis commented Jun 28, 2022

Here we go (I will add this with better detail to the Wiki and project source documentation):

          "device": "rc-wa_sda2",

RapidDisk-Cache device name.

          "reads": 276566,

Number of total reads to the RapidDisk-Cache front-node device. That means total reads that will hit both the RapidDisk RAM drive and backing store.

          "writes": 198611,

Number of total writes to the RapidDisk-Cache front-node device. That means total writes that will hit both the RapidDisk RAM drive and backing store.

          "cache_hits": 13201,

Number of read/write operations that hit the cache (i.e. the RapidDisk RAM drive).

          "replacement": 147282,

Follows a cache miss, where blocks are replaced into the cache volume i.e. the RapidDisk RAM drive).

          "write_replacement": 0,

Hmmm. I need to dig deeper into the code for this one. But this may be the writes replaced out of the cache. If that is the case, you would not see this increment in WA mode.

          "read_invalidates": 0,

Invalidated overlapping read cache blocks.

          "write_invalidates": 13572,

Invalidated overlapping write cache blocks.

          "uncached_reads": 3,

Backing store reads that were not cached.

          "uncached_writes": 198611,

Backing store writes that were not cached.

          "disk_reads": 263370,

Backing store reads.

          "disk_writes": 198611,

Backing store writes.

          "cache_reads": 13201,

Cached reads.

          "cache_writes": 263367

Cached writes.

EDIT:

In WA cache writes == disk_writes == uncached_writes ?

Yes, in a WA caching policy, that should be the case, because the writes are not cached.

@pkoutoupis
Copy link
Owner

@matteotenca This is next on my TODO list (i.e. documenting these fields) but am intrigued to learn more about this graphical piece. It would be neat.

@matteotenca
Copy link
Collaborator Author

@pkoutoupis Thank you for the informations. I'm writing a PHP app using some JS libraries to show graphs etc. I want to write a PHP interface (webserver involved) and a Python CLI tool using curses (never done this before, have to study).

I'm attaching two screenshots.

Regards

2022-07-02 09_08_07-RapidCurse – Mozilla Firefox
2022-07-02 09_09_28-RapidCurse – Mozilla Firefox
s

@pkoutoupis
Copy link
Owner

Updated Wiki to include stats description: https://github.com/pkoutoupis/rapiddisk/wiki/Miscellaneous#understanding-the-rapiddisk-cache-statistics and added you to the PR: #111

Also, the mockups look neat. Thank you for experimenting and doing this work.

@Augusto7743
Copy link

an very good feature for an very good utility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants