Storage

Persistent local web space for code and files.

# Booking

Web storage is a required component available in different plans. Each environment needs to have storage booked.

# Configuration

The storage is integrated as a persistent file system. You have direct code access by SSH and SFTP. The storage contains the deployed code, as well as runtime data, such as uploads and temporary files. See the directory structure article to learn about pre-configured folders. The dashboard shows metrics about the storage size.

# Scaling

When autoscaling is enabled, smaller and larger plans are automatically booked, based on usage. When autoscaling is disabled, the storage is capped at the chosen plan. Once the limit is reached, the environment can not write on the file system until space is cleaned. Web storage may grow over time as your website writes more files to the disk. Keep an eye on the metrics provided in the dashboard.

# Cleaning up the web storage

Web storage can grow in unexpected and undesired ways. Instead of just scaling up, review whether all storage is required and clean up if necessary:

  • Connect via SSH or SFTP
  • Use the du command to identify large files, see below
  • Review if all files are required
  • Delete unnecessary files, see below
  • Wait a few minutes for the fortrabbit system to detect the new usage

Once the issue is resolved, update your code and configuration to prevent excessive storage growth, such as implementing proper log rotation or cleaning up temporary files regularly.

# Finding large files with du

Use the du (disk usage) command via SSH to locate what's consuming the most storage:

# Show total size for current folder
du -sh
shell

# Common sources of excessive storage

  • Large assets uploaded by editors
  • Old log files that should be rotated or deleted
  • Temporary files and caches that can be regenerated
  • Backup files or database dumps that are no longer needed
  • User uploads that have been abandoned or duplicated
  • Generated versions of files from builds or assets that can be recreated

# Backups

Web storage backups are available through the additional backup component.

Found a tpyo?Edit