The simple version
Finding a book's shelf takes a few seconds. Doing that for a million books takes days, even if each book is tiny. Metadata work is counted in operations, not bytes.
Metadata operations
Opening a file typically involves a lookup, a permission check and an open; reading attributes is a stat; listing a directory is readdir plus, for ls -l, a stat per entry. On a parallel filesystem each can be a network round trip to a metadata server.
1.28 M files × 3 ops ÷ 50,000 ops/s ≈ 77 s per pass, before reading a single byte of data.
Cheaper habits
ls -f(orls -U) skips sorting; plainls -lon a huge directory stats every entry.lfs finduses Lustre-aware lookups and is usually faster thanfindon Lustre.- Don't put millions of files in one directory; spread them, or better, pack them into shards (Lesson 12).
Scaling metadata
Lustre's Distributed Namespace (DNE) spreads metadata across multiple MDTs: whole directories can live on different MDTs, and a single large directory can be striped across several (lfs mkdir -c N). Data-on-MDT keeps very small files on the MDT itself, saving a trip to an OST.
Measure, don't guess: mdtest (part of the IOR benchmark suite) creates, stats and removes many files across many clients and reports operations per second.
Tools
mdtestMetadata benchmark from the IOR project: create/stat/remove rates.
ls -f / ls -UList without sorting; avoids per-entry work on huge directories.
lfs findLustre-aware find.
lfs mkdir -c N DIRCreate a directory striped across N MDTs (DNE).
Quiz
Lab
Lab 3.1 · Starved dataloader
A vision model trains from /lustre/datasets/imagenet-raw: 1.28 million JPEGs averaging 110 KiB. nvidia-smi shows the GPUs mostly idle. The same images also exist as 1,024 tar shards in /lustre/datasets/imagenet-shards.
Try it now in the simulator (opens with the command ready; press Enter):
$ ls -lh /lustre/datasets/imagenet-raw$ simtrain --data /lustre/datasets/imagenet-raw --workers 64