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

Added guide documenting cache stats. #111

Merged
merged 3 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions doc/cache-stats.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
RAPIDDISK-CACHE STATISTICS
---------------------------


*** Normal output ***

0 78156289 rapiddisk-cache stats:
reads(1108), writes(297349)
cache hits(699), replacement(134), write replacement(146086)
read invalidates(2), write invalidates(34)
uncached reads(7), uncached writes(13328)
disk reads(409), disk writes(297349)
cache reads(699), cache writes(284423)


*** JSON output ***

{
"statistics": [
{
"cache_stats": [
{
"device": "rc-wt_sdf",
"reads": 1108,
"writes": 297349,
"cache_hits": 699,
"replacement": 134,
"write_replacement": 146086,
"read_invalidates": 2,
"write_invalidates": 34,
"uncached_reads": 7,
"uncached_writes": 13328,
"disk_reads": 409,
"disk_writes": 297349,
"cache_reads": 699,
"cache_writes": 284423
}
]
}
]
}


device: RapidDisk-Cache device name.

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

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

cache_hits: Number of read/write operations that hit the cache device.

replacement: Follows a cache miss, where blocks are replaced into the cache device.

write_replacement: Writes replaced out of the cache. Will be "0" in WA mode.

read_invalidates: Invalidated overlapping read cache blocks.

write_invalidates: Invalidated overlapping write cache blocks.

uncached_reads: Backing store reads that were not cached.

uncached_writes: Backing store writes that were not cached.

disk_reads: Reads from the backing store device.

disk_writes: Writes to the backing store device.

cache_reads: Reads from the cache device.

cache_writes: Writes to the cache device.



* For details on dm-writecache stats, please refer to https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/writecache.html.
9 changes: 6 additions & 3 deletions module/rapiddisk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) (int
nr_requests: Number of requests at a given time for the request queue. (Default = 128) (int)
rd_nr: Maximum number of RapidDisk devices to load on insertion. (Default = 0) (int)
rd_size: Size of each RAM disk (in KB) loaded on insertion. (Default = 0) (int)
rd_max_nr: Maximum number of RAM Disks. (Default = 128) (int)
rd_max_nr: Maximum number of RAM Disks. (Default = 1024) (int)


RapidDisk-Cache
Expand All @@ -29,15 +29,18 @@ RapidDisk
---------
It is advised to utilize the userland utility, rapiddisk, but this is essentially what is written to the /sys/kernel/rapiddisk/mgmt sysfs file to manage RapidDisk volumes:

Attach a new RapidDisk volume by typing (size in KB):
Attach a new RapidDisk volume by typing (size in bytes):
# echo "rapiddisk attach 8192" > /sys/kernel/rapiddisk/mgmt

Detach an existing RapidDisk volume by typing:
# echo "rapiddisk detach 0" > /sys/kernel/rapiddisk/mgmt

Resize an existing RapidDisk volume by typing (size in KB):
Resize an existing RapidDisk volume by typing (size in bytes):
# echo "rapiddisk resize 65536" > /sys/kernel/rapiddisk/mgmt

To view existing RapidDisk/RapidDisk-Cache volumes directly from the module:
# cat /sys/kernel/rapiddisk/devices



RapidDisk-Cache
Expand Down