Skip to content

cephfs-tool: Improve reporting and config options - #68519

Merged
vshankar merged 15 commits into
ceph:mainfrom
edwinzrodriguez:cephfs-bench
Jul 29, 2026
Merged

vshankar merged 15 commits into
ceph:mainfrom
edwinzrodriguez:cephfs-bench

Conversation

@edwinzrodriguez

@edwinzrodriguez edwinzrodriguez commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Add an option to output results in json format for better machine interpretation.
Add an option to specify a max duration for tests
Add an option to dump client perf counters
Add an option to set client cache parameters
Add an option to display progress during benchmark execution.
Add async I/O option

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added the cephfs Ceph File System label Apr 21, 2026
@edwinzrodriguez
edwinzrodriguez requested review from a team and batrick April 21, 2026 16:11

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit. Good work @edwinzrodriguez

Comment thread src/tools/cephfs/cephfs-tool.cc Resolved
@edwinzrodriguez
edwinzrodriguez force-pushed the cephfs-bench branch 3 times, most recently from d0b546f to 1cc5169 Compare June 18, 2026 14:46
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work.

I believe we have documentation for cephfs-tool and we should add to that for these new improvements (use LLM to write that out required :)

@edwinzrodriguez
edwinzrodriguez requested a review from a team as a code owner June 22, 2026 14:15
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

LGTM. Nice work.

I believe we have documentation for cephfs-tool and we should add to that for these new improvements (use LLM to write that out required :)

I updated docs for cephfs-tool

Comment thread doc/cephfs/cephfs-tool.rst Resolved
@@ -60,7 +64,7 @@ General Options

Path to keyring file

.. option:: --filesystem <name>
.. option:: --filesystem, --fs <name>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--fs is an option to the tool. for some reason wasn't documented that way originally. This fixes that oversite.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Without the context it seemed like adding an alias.

Comment thread doc/cephfs/cephfs-tool.rst Resolved
@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

1 similar comment
@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test api

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@edwinzrodriguez
edwinzrodriguez force-pushed the cephfs-bench branch 2 times, most recently from 3e84a75 to 069800a Compare June 25, 2026 12:51
@vshankar

Copy link
Copy Markdown
Contributor

@edwinzrodriguez - last commit does not have Signed-off-by tag.

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test api

1 similar comment
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test api

@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test windows

Add --json to write structured benchmark results (configuration,
per-iteration read/write metrics, and cross-iteration summary statistics)
to a file using JSONFormatter. Extend print_statistics() to optionally
mirror mean, stddev, min, and max into the JSON document. Improve
parse_size() to accept both SI (1000-based, e.g. "4MB") and binary
(1024-based, e.g. "4MiB") size suffixes.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add --duration to cap each read and write phase at N seconds instead of
running until all files are processed. Workers loop until the time limit
expires, cycling through their per-thread file set in duration mode.
Pass phase start time into worker threads for consistent cross-thread
duration checks. Only count each unique file once in stats even when
filenames are reused across cycles.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add --perf-dump to write libcephfs client performance counters to a file
at the end of the benchmark. Uses ceph_get_perf_counters() while the
mount is still active so counters reflect the full benchmark run.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add --client-oc and --client-oc-size to override libcephfs object cacher
settings before ceph_init. Enables benchmarking with the object cacher
enabled or disabled and with a configurable cache size. Resolved values
are shown in console and JSON output.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add --progress and --progress-interval to display live bandwidth, IOPS,
and ETA during read/write phases. A background progress_reporter thread
aggregates per-thread stats every 100ms and prints a single updating
status line. Progress percentage is based on elapsed time when --duration
is set, otherwise on files completed. Make ThreadStats fields atomic so
workers and the reporter can access them concurrently.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
…ration

Add --msgr-workers to override ms_async_op_threads before mount (1-24;
0 keeps the ceph.conf default). Controls async messenger I/O threads
independently of benchmark worker thread count. Validate the range at
startup and include the resolved value in console and JSON output.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
When built with CEPH_LOCKSTAT, add --lockstat-dump and --lockstat-threshold
to collect lock contention data during benchmark phases. Start collection
at benchmark begin, reset counters before each read/write phase, and dump
per-iteration/per-phase JSON files (e.g. base_iter1_write.json). Requires
a lockstat-instrumented libcephfs build.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add --async-io to use ceph_ll_nonblocking_readv_writev for read and write
workers instead of synchronous ceph_read/ceph_write. Add --queue-depth to
limit outstanding async I/Os per thread via a counting semaphore and
pre-allocated AsyncIOContext pool. Async write uses ceph_ll_create; async
read uses ceph_ll_walk + ceph_ll_open and defers inode release until all
async ops including readahead complete. Reject --async-io with
--per-thread-mount since async workers require a shared mount.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Set pthread names on all benchmark worker threads (wr-worker-N, rd-worker-N)
via ceph_pthread_setname so they are visible in top, perf, and lockstat
output during profiling.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
Add inline comments documenting each benchmark enhancement and its CLI
flag. Remove duplicate ceph_pthread_setname calls accidentally introduced
in sync read/write workers.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
…chmark runs

Added filesystem stats reporting to cephfs-tool.cc.

Helper functions
• fetch_statvfs() — uses ceph_ll_statfs on the root inode when --async-io
  is set, otherwise ceph_statfs on mount_root
• report_fs_stats() — prints and optionally JSON-encodes:
  • Total / free blocks
  • File count

When it runs
• Before the iteration loop (after the bench directory is created)
• After all iterations finish (before the final report and optional cleanup)

Console output example

Filesystem statistics (before iterations):
  Total blocks:      ...
  Free blocks:       ...
  Files:             ...

JSON output (when --json is used) adds a filesystem_stats section with before
and after objects containing the same fields.

Fixes: https://tracker.ceph.com/issues/76183
Signed-off-by: Edwin Rodriguez <[email protected]>
…` options

Add --async-write-fsync and --shared-file benchmark options.

--async-write-fsync sets ceph_ll_io_info.fsync on each async write to model
Ganesha-style write+commit and skips the post-phase ceph_ll_fsync when enabled.
--shared-file directs all worker threads at one file to stress client_lock
contention on a single inode.  Both options are recorded in JSON/text output.

Signed-off-by: Edwin Rodriguez <[email protected]>
@edwinzrodriguez

Copy link
Copy Markdown
Contributor Author

jenkins test make check

1 similar comment
@vshankar

vshankar commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check

bench_async_write_worker destroyed AsyncIOContext while the finisher
still ran async_io_callback after setting completed. Track in-flight
callbacks per worker and drain before tearing down the io_queue.

Signed-off-by: Edwin Rodriguez <[email protected]>
@vshankar

vshankar commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-07-08-09:12.

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

Comment on lines +79 to +91
.. option:: --client-oc <0|1>

Override the ``client_oc`` setting for the benchmark mount

.. option:: --client-oc-size <value>

Override the ``client_oc_size`` setting for the benchmark mount

.. option:: --msgr-workers <n>

Override ``ms_async_op_threads`` for the benchmark mount. Valid values are
``1`` to ``24``; ``0`` keeps the configured default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should already be possible with:

env CEPH_ARGS='--client-oc=X' cephfs-tool ...

Are you sure you want to wire these up?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first approach but couldn't get it working, so it seemed more consistent to add the cli option

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@batrick - would it be fine to take care of this later so that this change can be merged?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take care of this in a future change.

@vshankar

Copy link
Copy Markdown
Contributor

@edwinzrodriguez - I am fine with merging this if #68519 (comment) can be addressed (or we merge this and follow it up with that change)? WDYT?

@vshankar
vshankar merged commit c748ba8 into ceph:main Jul 29, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log c748ba8b792298b3d101e84af31b519a3a4fe0df^..c748ba8b792298b3d101e84af31b519a3a4fe0df

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/30432492428

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants