FSAssets: inodes, storage and performance
Monitor inodes, filesystem usage, small files, mountpoints and I/O risks.
Why inodes are critical
On ext4, each file and directory consumes an inode; the total inode count is set when the filesystem is created. FSAssets creates many .gz files in nested directories. A volume can show 50% free disk space and 100% inode usage: new files fail despite apparent capacity.
Measure disk and inode usage
df -h reports byte capacity; df -i reports inode capacity. Run both on the actual directory, not only /. Resolve symlinks and verify the real mount.
Adapt this example: never run blindly in production.
readlink -f /srv/opensim/fsassets/data findmnt -T /srv/opensim/fsassets/data df -h /srv/opensim/fsassets/data df -i /srv/opensim/fsassets/data du -sh /srv/opensim/fsassets/data /srv/opensim/fsassets/tmp
Count files without guessing
A full tree walk over millions of files can be expensive and add metadata I/O load. Run off-peak and only on the correct tree. The number of .gz files is not identical to metadata rows because of content deduplication.
Adapt this example: never run blindly in production.
# Potentiellement très coûteux sur un grand volume : find /srv/opensim/fsassets/data -type f -name '*.gz' -printf '.' | wc -c # Échantillonner les sous-répertoires de premier niveau : du -h --max-depth=1 /srv/opensim/fsassets/data | sort -h | tail
Ext4 and XFS differ
Ext4 normally establishes inode density during mkfs with options such as -i. XFS allocates inodes dynamically, subject to filesystem limits and available space. df -i remains useful on both. Never reformat an existing FSAssets disk to 'add inodes': this destroys data.
When inodes run out
Symptoms include create-file/directory failures, 'No space left on device', growing spool and new asset failures. Preserve logs, then inspect both df -h and df -i; similar messages can also mean full disk, quotas or read-only remounts.
Capacity alerts and forecasting
Monitor byte usage, inode usage, file count and spool size independently. An example local policy is early warning at 70%, action at 85% and urgent response at 95%, adjusted to your growth. These are operational examples, not OpenSimulator constants.
Adapt this example: never run blindly in production.
df -P /srv/opensim/fsassets/data df -Pi /srv/opensim/fsassets/data stat -f -c 'Type=%T Inodes libres=%f? (voir df -i)' /srv/opensim/fsassets/data # Évolution : enregistrer ces métriques chaque jour via supervision
Spool size is a health indicator
FSAssets uses SpoolDirectory/spool and SpoolDirectory before writing the final store. If the writer stops processing due to permissions, disk, inode or I/O errors, spool may accumulate. Never clear it as a cache: it can contain assets not yet committed to BaseDirectory.
Adapt this example: never run blindly in production.
du -sh /srv/opensim/fsassets/tmp find /srv/opensim/fsassets/tmp -maxdepth 1 -type f | wc -l ls -ld /srv/opensim/fsassets/tmp /srv/opensim/fsassets/tmp/spool
HDD, SSD and NAS performance
Many small files stress metadata and IOPS; latency can matter more than sequential throughput. Measure iostat, iowait, latency and disk errors before migration. On NAS, also validate locking, rename semantics, durability and network outages; not every network filesystem is suitable for spool.
Adapt this example: never run blindly in production.
iostat -xz 1 5 vmstat 1 10 journalctl -k --since '2 hours ago' | grep -Ei 'I/O error|ext4|xfs|nvme|ata'
Other constraints beyond inodes
Check user quotas, filesystem reserves, permissions, snapshots, backup destination capacity and temporary file allocation. SQL metadata and log files may live on different disks: monitor each separately.