Disk Optimizations - aaronwmorris/indi-allsky GitHub Wiki
General
Reducing disk I/O on SD and MMC class storage devices can significantly extend their lifetime.
You can monitor per-process disk IO with sudo iotop -oPa
journald
systemd journald logging contributes to a significant amount of disk I/O. Changing the storage to volatile only logs to memory. This can result in an 80% reduction of IOs on a standard all sky system.

sudo mkdir /etc/systemd/journald.conf.d
sudo tee /etc/systemd/journald.conf.d/90-indi-allsky.conf <<EOF
[Journal]
Storage=volatile
Compress=yes
RateLimitIntervalSec=30s
RateLimitBurst=10000
SystemMaxUse=20M
EOF
sudo systemctl restart systemd-journald
ext4 commit interval
Add commit=300 to the mount options for the filesystems.
-
File:
/etc/fstabUUID=abcdabcd-1234-4c97-1234-181c2d402646 / ext4 defaults,noatime,commit=300 0 1
Decrease swappiness
This will decrease the rate at which the Linux kernel will swap out memory pages to the swap file and reduce disk I/O.
echo "vm.swappiness = 1" | sudo tee /etc/sysctl.d/90-indi-allsky.conf
sudo sysctl --system
tmpfs
Utilize a memory backed filesystem for /tmp to reduce writes
# /etc/fstab
...
tmpfs /tmp tmpfs defaults,nosuid,size=512m 0 0
...
Relocating the Image Directory to External Storage
To eliminate image capture writes to the SD card, you can move the image directory to an attached SSD, hard drive, or USB flash drive:
-
Stop services:
sudo systemctl stop indi-allsky.service gunicorn-indi-allsky.service -
Create target directory & copy existing images:
sudo mkdir -p /mnt/storage/allsky/images sudo rsync -av /var/www/html/allsky/images/ /mnt/storage/allsky/images/ -
Update Flask configuration (
/etc/indi-allsky/flask.json): SetINDI_ALLSKY_IMAGE_FOLDERto your new path:"INDI_ALLSKY_IMAGE_FOLDER": "/mnt/storage/allsky/images", -
Update Camera configuration: In the Web UI under Configuration → Camera Settings, set
IMAGE_FOLDERto/mnt/storage/allsky/images(or via CLI withindi-allsky-ctl config). -
Repair and apply directory permissions with
indi-allsky-ctl:sudo indi-allsky-ctl fix-permsfix-permsinspects/etc/indi-allsky/flask.jsonand the database, automatically creatingdarks/andexport/subdirectories and applyingchown -R indi-allsky:www-dataandchmod 775permissions. -
Restart services:
sudo systemctl start indi-allsky.service gunicorn-indi-allsky.service