Jump to content

Storage: Difference between revisions

no edit summary
No edit summary
Line 60: Line 60:
tootctl media remove-orphans
tootctl media remove-orphans
</syntaxhighlight>
</syntaxhighlight>
=== Logs ===
Logs end up being a surprisingly large contributor to storage burden!
==== Systemd ====
* Config reference: https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html
Most of the large logs are managed by systemd/journald. To prevent these from growing out of control, we set a global maximum disk usage of 5G, and then set a relatively small cap for each individual file so that they are rotated/archived frequently. We additionally delete all log files older than one month, if they manage to escape these caps.
In <code>/etc/systemd/journald.conf</code>
<pre>
[Journal]
Storage=auto
Compress=yes
SystemMaxUse=5G
SystemMaxFileSize=64M
SystemMaxFiles=10
MaxRetentionSec=1month
</pre>
After editing this configuration, reload it:
<pre>
sudo systemctl restart systemd-journald
</pre>


== Reference ==
== Reference ==


* Helpful info on managing disk usage with [[tootctl]] - https://ricard.dev/improving-mastodons-disk-usage/
* Helpful info on managing disk usage with [[tootctl]] - https://ricard.dev/improving-mastodons-disk-usage/