immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
49.94k stars 2.65k forks source link

Storage reporting is still shows wrong size #9514

Closed picarica closed 1 month ago

picarica commented 5 months ago

The bug

my web ui installed within truenas shows 256kb of usage even when 600 pictures and several 100gb videos uploaded i saw this issue #2462 and saw it was solved? but it doesnt seem like #2560 i thought this was a fix too, but sitll not my behavior is same as in this 2 months old reddit thread https://www.reddit.com/r/immich/comments/1b4ai01/real_capacity_of_immich_with_truenas/

The OS that Immich Server is running on

TrueNAS-SCALE-24.04.0

Version of Immich Server

v1.105.1

Version of Immich Mobile App

not relevant

Platform with the issue

Your docker-compose.yml content

not sure truenas default

Your .env content

not sure

Reproduction steps

1. install truenas
2. install immich
3. issue exists

Relevant log output

No response

Additional information

with truenas i am using default ixvolumes i wonder if host path would be used if it would fix the issue

mertalev commented 5 months ago

I think this might be a quirk of ZFS since everything is on a separate dataset. We only look at the library folder to get disk usage info, so in this case the used space is just the size of the library folder. I'm not sure what the best way to fix this would be.

picarica commented 5 months ago

idk this may sound amateurish but just getting size with du and report it to GUI? should work on zfs no ?

mdafer commented 5 months ago

One workaround, that worked for me (using geesefs to mount S3 buckets as local storage), is to set a quota limit on your account. Eg. instead of unlimited, use 100 TB for example. This way I can now see the used storage out of the limit.

Using du could deteriorate performance pretty quickly for us (who mount different kinds of storage, especially Object stores such as minio or s3), in my case, it could take hours to traverse the whole tree and get the total size.

I haven't checked how the size is being calculated when a limit is set, and I could be mistaken, but I'm assuming that it's calculated from the meta in Immich rather than from storage as I'm pretty sure it would be much slower to do it accurately from storage in my case.

mertalev commented 5 months ago

I'm assuming that it's calculated from the meta in Immich rather than from storage

This is right. Usage is stored in the DB and updated when assets are added or deleted.

I suppose we could change to display the immich library size instead of the disk size. The latter is hard to get right since you can mount different drives for each folder, filesystems can handle usage differently, etc.

danieldietzler commented 1 month ago

This sounds like it has been clarified/become a feature request more than an issue.

Elyviere commented 1 month ago

So is there a feature request created for this? Because I'd definitely argue that installing Immich on TrueNAS Scale with the official app and default settings should warrant correctly showing the amount of used space. It not displaying correctly definitely sounds like a bug more so than a feature request.

alextran1502 commented 1 month ago

@Elyviere the TrueNAS template is handled by the TrueNAS team, I think it will have to be handled from that end