Every large file uploaded to an S3-compatible bucket goes through a multipart upload. The client splits the file into chunks (typically 5 MB to 100 MB each), uploads them in parallel, and finally tells the storage API to stitch them together into a complete object.
Here is the trap: if the network drops halfway through, or a deployment worker is killed by an out-of-memory killer, those uploaded chunks do not disappear. They sit in your bucket as uncommitted parts. They do not appear in <code>aws s3 ls</code>, but they consume storage and appear on your bill month after month.
The monthly cost of ghost storage
Because incomplete parts are invisible in standard file listings, teams often discover them only after their storage usage creeps upward despite file counts staying flat.
| Daily abandoned uploads | Average size | Ghost storage after 90 days | Monthly waste at $0.020/GB | Monthly waste at $0.023/GB (AWS S3) |
|---|---|---|---|---|
| 5 failed backup jobs | 20 GB | 9.0 TB | $180.00 / mo | $207.00 / mo |
| 20 interrupted video uploads | 2.5 GB | 4.5 TB | $90.00 / mo | $103.50 / mo |
| 50 interrupted database dumps | 8 GB | 36.0 TB | $720.00 / mo | $828.00 / mo |
| 100 worker crashes (small batches) | 500 MB | 4.5 TB | $90.00 / mo | $103.50 / mo |
How to inspect incomplete uploads from the CLI
To see what is currently lingering in your bucket, standard <code>list-objects</code> will not work. You must use the low-level <code>list-multipart-uploads</code> API command:
If any uploads were abandoned, the response returns a JSON structure listing the file key, the initiation timestamp, and the unique <code>UploadId</code>:
To inspect the exact parts and bytes held by that upload id:
A tested Python script to clean up abandoned parts
While AWS S3 offers native S3 Lifecycle rules to abort uploads after N days, many S3-compatible providers, private minio setups, and edge gateways do not support or trigger lifecycle policies automatically. This lightweight Python script audits any bucket and aborts uploads older than your chosen threshold:
Best practices for production pipelines
- Run a weekly audit cron: Add the audit script to a weekly cron job. Setting
--days 3provides plenty of runway for legitimate 24-hour uploads to complete while purging stale clutter. - Catch client interruptions: In custom Node.js, Python, or Go upload scripts, always hook into process signals (
SIGTERM,SIGINT). If an upload loop is cancelled by the user, callabort_multipart_uploadimmediately before exiting. - Tune your part sizes: Avoid tiny 5 MB part sizes on multi-gigabyte files. Larger parts mean fewer HTTP requests and fewer stranded chunks if a connection resets. See our analysis on [multipart upload part sizes for 5 GB, 50 GB and 500 GB files](https://tport.space/articles/multipart-upload-part-size-5gb-50gb-500gb) for benchmarked thresholds.