Matomo using way more disk space then reported

Matomo is using 110GB on our server and I’m trying to reduce this. I’ve already tweaked all settings to delete old reports (6 months), delete old visitor data after 90 days. I run cron archive and even manually purged.

However, Matomo is reporting +/- 55gb disk space use, but the actual mysql folder is using almost 100gb. Apparantly the blobs use way more then matomo claims.
Where/why is this difference so big?

See this screenshot for an weird example: https://i.gyazo.com/111bff2fc55999cc9237ace85fad3250.png
This is the matomo “Database usage” plugin to the left, versus the mysql data folder to the right.

Is matomo somehow not deleting all data properly?

I’ve run Matomo 3.4 for a long while, and have also just updated to 3.6 and tried purging/archiving again. No change.

I’m pretty sure this is a visual error named: logical vs physical size

The provided screenshot looks like you just run ls on it. This only reports the logical size.

Run du -h piwik_archive_blob_2017_06.ibd and it will show the physical size of that file (it should be very close to the 12 MB Matomo says).

So long story short: Don’t trust ls if you are looking at some sort of container.

Some illustration: Sparse file - Wikipedia

Thanks, I believe you’re right!
(After running mysql optimise now even ls -lah shows the “correct” values.)

Also: phpmyadmin reports the same DB sizes as matomo, so it’s def. not an matomo issue.