im noob in this and i need help lolol
ezwizi420
FREEOP

14 days ago

Hello Railway Support,

I'm experiencing a discrepancy between the volume usage reported in the Railway dashboard and the actual disk usage inside my running service.

My volume, worker-volume, is mounted at /data in the worker service and has a configured size of 500 MB. The Railway dashboard reports approximately 75% usage (around 375 MB).

However, when I connect to the running service via SSH, I get the following results:

  • df -h /data: 434 MB total, 8 MB used, 416 MB available (2% usage).
  • du -h -d 1 /data: approximately 7.8 MB of files.
  • du -sh /app: 560 KB.

I've also checked the files in /data, and their sizes are consistent with the du output.

Could you help me understand what the dashboard's volume usage metric is measuring and why it differs so significantly from the disk usage reported inside the container?

I've attached screenshots of the Railway volume metrics, volume settings, and terminal output for reference.

Thank you!

Solved

3 Replies

Railway
BOT

14 days ago

The dashboard's volume usage metric reports the storage layer's allocated blocks (ZFS usedbydataset), not the logical size of files inside the container. When files are deleted or rewritten, the freed blocks are only returned when they are discarded back to the storage layer, and because the volume allocates in 16 KB blocks while the container's filesystem frees in 4 KB blocks, partially freed blocks can never be returned, so the metric settles permanently above what df/du reports. Your df and du agreeing at ~8 MB confirms the data inside your container is fine and there is nothing to fix. Billing is based on this same metric (averaged per minute at $0.15/GB-month), but the dollar impact of the gap is typically small.


Status changed to Awaiting User Response Railway • 14 days ago


Railway

The dashboard's volume usage metric reports the storage layer's allocated blocks (ZFS `usedbydataset`), not the logical size of files inside the container. When files are deleted or rewritten, the freed blocks are only returned when they are discarded back to the storage layer, and because the volume allocates in 16 KB blocks while the container's filesystem frees in 4 KB blocks, partially freed blocks can never be returned, so the metric settles permanently above what `df`/`du` reports. Your `df` and `du` agreeing at ~8 MB confirms the data inside your container is fine and there is nothing to fix. Billing is based on this same metric (averaged per minute at $0.15/GB-month), but the dollar impact of the gap is typically small.

ezwizi420
FREEOP

14 days ago

Thank you for the explanation! Is there a safe way to reclaim the approximately 300 MB of allocated space that is no longer being used by my files? If this requires recreating or migrating the volume, how can I do it without losing my SQLite database or backups? Could this allocated space eventually cause my volume to reach its capacity limit, and is there a way to prevent the discrepancy from growing?


Status changed to Awaiting Railway Response Railway • 14 days ago


Railway
BOT

14 days ago

There is no way to reclaim those allocated blocks - the 16 KB block floor is permanent, fstrim is not permitted inside containers, and we do not offer a volume-rebuild workaround for bringing the number down. The gap does not grow without bound because continuous discard handles ongoing frees, so it settles rather than creeping toward your 500 MB cap on its own, and at ~460 MB of excess the billing impact is roughly $0.07/month.


Status changed to Awaiting User Response Railway • 14 days ago


Railway
BOT

7 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 7 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...