Files
CephfsMig/docs/smallfiles-local.md
Sebastian UnterschützandClaude Opus 5.5 4b43dd414f docs: bring documentation up to date
Add the 2026-12-03 small-files run, mark the million-file run as older than
parallel verification and the client replacement, note that the single lab
OSD limits the measured durations, and correct the /dev/fuse requirement and
the list of transfer statistics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 07:52:17 +01:00

5.9 KiB

Local test with many small files

Measured with Ceph 21.2.0, most recently on 2026-12-03. Two independent lab clusters, each with one MON/MGR/MDS and one file-backed 4 GiB BlueStore OSD on the same host; four copy workers.

Each file contains 128 bytes of deterministic data that is not all zeros. Half of the files are in one large directory, the other half spread over 50 directories. In addition: 100 hardlink names and 100 symlinks. Changes: 1 % each of contents, deletions, renames, new files, mode/xattr changes and xattr removals. The 2,000-file runs also contain numeric owners and access/default ACLs.

Current run with 10,000 files (2026-12-03)

Code state 6dcb7b6: the writing client is replaced before verification, verification runs in parallel, and skipping unchanged subtrees is removed.

Phase Duration Payload written MDS requests, both clusters
Initial run, two states 197.7 s 1,280,000 bytes 417,389
Catch-up round 36.2 s 64,128 bytes 165,266
Final round 39.1 s 0 bytes 184,031

The catch-up round copied 501 files. Maximum process RSS across the phases: 167.0 MiB. The independent application client compared the live target, the source snapshot baseline and the remaining round snapshot, each with 10,100 regular file paths including hardlinks, plus symlinks and metadata; all checks passed in 422.2 s. Older round snapshots were already removed by sync.

Compared with the run before optimization below, the catch-up round dropped from 459.3 s to 36.2 s and the final round from 84.1 s to 39.1 s. Between the two runs lie the optimizations listed under implemented changes, the client replacement before verification and parallel verification; their individual shares were not measured.

Comparison with 2,000 files (2026-11-05/06)

Phase Before After MDS requests before MDS requests after
Initial run, two states 490.2 s 55.2 s 115,132 87,437
Catch-up round 52.2 s 21.2 s 52,677 38,911
Final round 30.1 s 24.1 s 59,350 41,074

In the final run: 30.8 % fewer MDS requests, 20.0 % shorter runtime. Both variants wrote 0 payload bytes there. The catch-up round wrote 12,928 bytes for 101 files in both variants.

Measured maximum process RSS across the phases: 93.7 MiB before, 76.4 MiB after. Ceph daemons, CLI children and the application client are not included.

The old version showed MDS read lock waits in the initial run. Other earlier runs took about 99 s there. The large difference in the initial run is therefore no general promise of a speedup. The comparison interrupted overnight and its restart are not included as a comparison measurement.

Completed test with 10,000 files, before optimization (2026-11-05/06)

Phase Duration Payload written
Initial run, two states 554.4 s 1,280,000 bytes
Catch-up round 459.3 s 64,128 bytes
Final round 84.1 s 0 bytes

The independent application client compared a total of 50,500 regular file paths including hardlinks, live and in four historical states, plus symlinks and metadata. All checks passed. This additional test check takes 600.7 s and is not part of the measured duration of finalize. Remount and application restart are not included either.

The copier reached 135.4 MiB process RSS. Journal and index took 1.59 MiB at the end. Before the cleanup, Ceph reported about 271.2 MiB of additional raw usage at the source and 726.6 MiB at the target. These values also include internal overhead and journal and BlueFS/RocksDB growth.

Implemented changes

  • A complete local path inventory of the immutable source snapshot for pruning and the check for surplus paths; repeated source stat calls per target path are gone. Incomplete inventories prevent pruning.
  • No repeated index write transactions for identical inode rows.
  • No repeated setattr calls for already identical owner, mode and mtime; the target stat is reused during verification.
  • Data buffers sized to the file size or verification length, at most 4 MiB per buffer.
  • AT_STATX_DONT_SYNC only for immutable snapshot paths; live target paths keep normal synchronization semantics. Ceph's own mirror uses the same snapshot access.

Limits and reproduction

In the lab, the single OSD per cluster limits the tests, not the copier. During an aborted 100,000-file run in December 2026, writing one small file took about 50 ms, mostly OSD write latency (op_w about 32 ms) plus MDS journal latency (about 20 ms). Each cluster has only one OSD, both share one host disk (encrypted with LUKS), and they run without replication. More workers therefore hardly shorten the runs. The durations measured here say little about a production cluster with many OSDs.

MDS requests are not physically measured disk IOPS. The runs are single measurements on a shared host, without guaranteed cache conditions. Full metadata passes remain; 200 million files still need change planning that skips unchanged subtrees. A first attempt based on inode version and ceph.dir.rctime missed changes and was removed (see metadata scan). The results are no release for that scale.

make dev-smallfiles-test
# smaller test with MDS counters:
FILES=2000 REPORT_DIR=/tmp/cephmig-smallfiles-report make dev-smallfiles-test

On success, the test programs remove their own subvolumes, snapshots, claims and local state files. Ceph may report freed space with a delay. Raw data, binary hashes and details are in smallfiles-local.json.

In addition, the Go tests with the race detector and go vet for the native build passed, as did the complete native functional test with large/sparse files, blockdiff, historical snapshots, ACLs, quotas, hardlinks to symlinks/FIFOs, cancellation and SIGKILL resume. The fixtures of the successful run were removed.