Huge difference with the number of files and their total size between the database and the S3 stockage

Hi everybody,
First, sorry if I chose the wrong category.
My hierarchy needs statistics upon users, files and storage.
We have 5 instances (and soon 10…) and I don’t want to go through each instance to get figures.
From 1 server, I can query each database. so, I wrote a script to collect statistics for each instance.
But (there is always a “but”), there is a huge difference between the statistics from the database and from the S3 storage. For 1 instance, there are 200 000 more files in the table oc_filecache (db=15,1M / S3=14,9M)! Worse than that, the difference between the total size of all files is insane: db=115 To / S3=25 To!
How is it possible? The query I wrote is:
select count(fileid) as nbfichiers, sum(size) as sommetaille from oc_filecache where path like ‘files/%’ and storage in (select distinct(numeric_id) as numeric_id from oc_storages where available=1);
I can’t run a “du” command because I don’t have access onto the storage servers. I just can do mc du through the minio client but it takes a really long time and the results confirm the difference.
I hope everything is clear and I thank you in advance if you can help me to solve this problem.

Checkout Grafana or Glances.

Thank you but we don’t have yet neither Grafana nor Glances.
The extractions from the databases let me build pivot tables with very few manipulations. And hierarchies love pivot tables! :smiley:
Beyond that, I want to understand why there is such a difference.