3 hours ago
Hi Railway team,
My volume "the-vital-shift-volume" (500MB, mounted at /app/data on service "the-vital-shift") shows 79% capacity (~395MB used) on the Metrics dashboard.
When I open a shell into the running container via the Console tab and check directly:
- du -ah /app/data shows total usage of only 20MB (a 2MB database file plus ~18MB of rotating backup copies)
- df -h /app/data reports: /dev/zd22576 434M 20M 404M 5% /app/data - the filesystem itself agrees only 5% is used
So there's roughly 375MB of "used" space on the volume not backed by any file visible inside the container. I confirmed Railway's own PITR/snapshot backup feature is not enabled on this project, so that's not the cause.
I tried running fstrim -v /app/data from the console to reclaim stranded/deleted blocks myself, but it failed with "FITRIM ioctl failed: Operation not permitted" (the container lacks the privilege for that ioctl).
Could someone reclaim/trim the underlying storage for this volume, or explain the discrepancy?
Volume device (from df): /dev/zd22576
Service: the-vital-shift
Environment: production
Thanks!
1 Replies
3 hours ago
The volume metric reports ZFS-level allocated blocks, not the logical file size visible inside the container. When files are deleted or rewritten, freed ext4 blocks are only returned to the underlying ZFS storage layer via TRIM/discard, and because volumes allocate in 16 KB blocks while ext4 frees in 4 KB blocks, partially-freed blocks can never be returned, so the metric settles permanently above what df/du show. Your df and du agreeing at ~20MB confirms there are no leaked file descriptors or hidden files; the gap is entirely at the storage layer. The fstrim permission error is expected since containers lack the required capability, and we do not run host-side reclaims on request. Billing is based on this metric (currently ~0.39 GB at $0.15/GB-month, so roughly $0.06/month for the excess), not on df output. Nothing is wrong with your data or your volume; there is nothing you need to do.
Status changed to Awaiting User Response Railway • about 3 hours ago