Ozone handles far more small files than HDFS, but it does not make them free. Every key is a metadata entry held by the Ozone Manager, so millions of tiny files still raise memory use, slow listings and lengthen recovery. Diagnose first by counting files by size, then fix the cause: write fewer, larger files, compact existing ones, choose the right bucket layout and watch the metadata service.
Symptoms
Small-file trouble rarely shows up as an error. It shows up as slow behaviour that gets worse as the key count grows.
| Symptom | Likely cause | First check |
|---|---|---|
| Directory or prefix listings take longer each month | Very large number of keys under one path | Count keys under the slow path |
| Queries spend most of their time planning or opening files | Thousands of tiny files per table or partition | Files per partition and average file size |
| The Ozone Manager uses more memory or restarts slowly | Metadata growth from key count | Key count and process memory trend |
| Deletes and renames are slow on a large tree | Bucket layout mismatch or very deep trees | Bucket layout and operation type |
| Jobs run many short tasks | One task per file | Task count against input size |
| Replication or recovery takes longer than planned | Large numbers of objects to move | Object count, not only terabytes |
Compare against your baseline. A number alone does not tell you much, but a trend does, so record key counts and average file size monthly. If you came from HDFS because of small files, read Ozone vs HDFS and the scenario a small-files workload first.
Metadata load
Ozone separates metadata from data. The Ozone Manager holds the namespace, and the Storage Container Manager tracks containers, as the architecture overview explains. Small objects are cheap on the data side, because they pack into containers. The cost sits in the metadata: one entry per key, whatever its size.
Three practical points follow. Fast storage matters, and Cloudera advises low-latency media such as NVMe or SSD for metadata and DataNode volumes. Memory matters, so size the Ozone Manager for your key count and growth, not only for today's count. And layout matters, because directory operations behave differently on file system optimized and object store buckets.
A quick profile
- Count keys per bucket and per top-level path.
- Bucket them by size: under 1 MB, 1 to 16 MB, 16 to 128 MB, over 128 MB.
- List the ten tables or prefixes with the most files, and the owner of each.
- Note which files are written by streaming jobs, which tend to create many small files.
- Record the share of keys that are older than your retention rule.
Most estates find that a few producers create most of the small files. Fix those first.
Fixes
Treat the cause, not the symptom. Commands and settings vary by release, so check your documentation.
| Fix | What it does | Cost or risk |
|---|---|---|
| Write larger files at the source | Set batch sizes, partitioning and commit intervals so jobs write fewer, larger files | Needs code or job changes, and is the cheapest long-term fix |
| Compact existing data | Merge small files in each partition into target-size files | Compute cost, and a window with no concurrent writers or a table format that handles it |
| Use a table format that compacts | Open table formats offer compaction; see Iceberg table maintenance and compaction | Needs scheduling and monitoring |
| Choose the right bucket layout | Use the file system optimized layout for directory-heavy workloads, as described in Ozone vs HDFS | Layout is chosen at bucket creation |
| Reduce partition depth | Avoid partitioning by columns with too many distinct values | Query design change |
| Delete what you do not need | Apply retention to old and temporary files | Needs owner sign-off |
| Scale and tune the metadata service | More memory or faster storage for the Ozone Manager | Hardware and a restart plan |
Do not reach for erasure coding to solve a small-file problem. It changes how data is stored, not how many keys exist, and files smaller than a stripe gain less from it. See sizing and erasure coding.
Prevention
The cheapest runbook is the one you rarely open. Write down a standard for producers, so small files do not come back after you fix them:
- A target file size for each table class, agreed with the owners.
- Commit intervals for streaming jobs that balance freshness and file count.
- A compaction schedule for each table, with an owner and a failure alert.
- A review of any new job that writes more than a set number of files a day.
- A retention rule for temporary and staging paths, enforced by a job and not by memory.
Add the standard to your onboarding for new data teams, and check it in the quarterly platform review.
Monitoring
Set up checks before you need them. Collect these from the Ozone Manager and the cluster's monitoring tools, and review them monthly:
| Measure | Why | Alert when |
|---|---|---|
| Total keys and growth rate | The main driver of metadata load | Growth is faster than your sizing plan |
| Average file size per top table | Shows producers writing small files | A table drops below its target |
| Ozone Manager memory and pause time | Early sign of metadata strain | A steady upward trend |
| Listing and open latency on a sample path | What users feel | It exceeds the baseline by a set margin |
| Compaction job success | Confirms the fix still works | A run fails or is skipped |
Add a small-file report to the weekly data platform review, owned by one named person. Duczer East runs this kind of profile in a storage fit assessment. If you plan a move, see HDFS to Ozone migration steps.



