How do I reduce disk usage for MySQL database in Hubzilla?
We allow you to expire any of these things at whatever time interval you choose. Default retention for dreport is 30 days. Default for stream posts (those posts that are not your own) is forever, but this can and should be
changed in site/admin. I recommend 30-60 days, but it's totally up to you and the needs of your community. If I
recall there's a separate config for expiring purely "public content" that is imported/shared from other sites via /public or the "discover" tab. These I wouldn't keep around for more than about a week. The queue is self-expiring. The physical sizes of the DB files is misleading because in many cases the tables are full of deleted table entries and the space will eventually be reclaimed by newer entries. We once did "optimize table" instructions (like defragmenting a disk) on these dynamic tables but this results in tables crashing quite often or the database becoming unresponsive while being optimized. We eventually removed all of these calls.
You can modify this with
util/config system expire_deliver_reports 14
or disable it all together:
util/config system disable_dreport 1
system.disable_dreport If '1', don't store or link to delivery reports
The reason this isn't the default is because most site admins cannot or will not read logs when their members encounter delivery issues, forcing somebody like me (who ends up dealing with the issue) to attempt clairvoyance on the server in question. Having a delivery report allows the member to easily ascertain if the message was delivered/queued/permission denied or whatever to a particular recipient and without requiring their hub admin to be useful at anything or even semi-conscious.
As mentioned earlier, this table usually consists of 95% overhead or deleted entries because we expire them somewhat aggressively - for the benefit of sites that are severely disk limited. Anyway, you can turn delivery reports off completely and recreate the table and it should thereafter use 0GB. I just refuse to troubleshoot any delivery issues involving your hub members.
If you need to shrink an already metastasized-to-ridiculous-proportionsl dreport table, you can do this:
mysql -uhubzilla -h127.0.0.1 hubzilla Enter Password: > > delete from dreport; > optimize table dreport;