Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Detailed read/write statistics and histograms#244

Open
abzmr wants to merge 3 commits intoarchiecobbs:masterfrom
abzmr:stats2
Open

Detailed read/write statistics and histograms#244
abzmr wants to merge 3 commits intoarchiecobbs:masterfrom
abzmr:stats2

Conversation

@abzmr
Copy link

@abzmr abzmr commented Oct 17, 2025

Improve statistics to get insights into actual FUSE/NBD access patterns. See both commit comments for more details.
These were some quick hacks that work fine, and could possibly use some more beautification :)
Stats file format is changed somewhat, which might bite people that process it.

Anne Bezemer added 2 commits October 10, 2025 21:39
Write stats now provide more details to gauge effects of blocksize choice:

  write_hits_fullblock      - Block was in cache and was fully overwritten
  write_hits_partialblock   - Block was in cache and was partially overwritten
  write_misses_fullblock    - Full block was newly introduced into cache
  write_misses_partialblock - Block was downloaded(*) and then partially overwritten

(*) Note that zero-cache has already been passed, so download will always
be attempted even if known to be all-zero or non-existent.
For operations executed via the FUSE and NBD front-ends, detailed statistics
are now recorded. These may help to evaluate blocksize choice for the
specific use case.

"Requestbytes" and "requestalign" provide histograms on front-end request
size and alignment, which are independent of any s3backer settings.
"Requestalign" smaller than blocksize means initial partial block access
per front-end request.
"Fullblocks" and "trailerbytes" provide histograms on the number of complete
blocks resp. trailing partial blocks per front-end request.
These are available separately for read and write requests; and also trim
in case of NBD.
FUSE uses fallocate(PUNCH_HOLE) to pass TRIM requests.
And since that is the only variant actually executed in fuse_ops.c,
record these requests into TRIM histogram.
@archiecobbs
Copy link
Owner

Two suggestions on this patch...

Instead of replacing counters, just add new ones. E.g., keep stats.write_hits and have it count the same thing as before, and then also add write_hits_partialblock and write_hits_fullblock. This preserves backward compatibility.

The histogram stuff might be better off in a new file, i.e., a peer of stats maybe called histo or whatever. This will require complexifying fuse_ops.c a bit but would keep things better organized.

@abzmr
Copy link
Author

abzmr commented Nov 22, 2025

Thanks for the good suggestions.
Since things are humming along very nicely here, I've had to move on to other interesting stuff.
So I'll leave this to be picked up by anyone interested :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants