immich-app / immich

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

[BUG] (web & mobile) Map loading very slowly with a lot of assets #4174

Open klejejs opened 1 year ago

klejejs commented 1 year ago

The bug

I have more than 70k of assets and since adding more and more of them, I have noticed that the map is loading slower with more assets.

I assume this is due to all assets being preloaded on the map open, it would be nice if only the approximate counts were loaded in larger zoom levels and specific assets only when the map is zoomed in.

The OS that Immich Server is running on

Ubuntu 22.04, iOS 17

Version of Immich Server

v1.79.0

Version of Immich Mobile App

v1.79.0

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Upload many assets
2. Open map on mobile or web
3. See that it takes very long for the map to load

Additional information

No response

jrasm91 commented 1 year ago

The way the clustering UI feature works it needs all the assets up front. The alternative is probably a different tool or custom approach. Can you confirm that the API endpoint returns quickly and the clustering and rendering is what is slow?

klejejs commented 1 year ago

Yes, that indeed is the case. The request takes 3 - max 5 seconds, and after that, it takes at least 10 seconds for something to show up. Furthermore, I believe it is still doing something in the background as the page hangs and it needs to be refreshed to navigate to a different page.

HarHarLinks commented 1 year ago

I'm facing the same issue with only 3000 assets, of which probably less than 1000 are geotagged at all.

d3vv3 commented 1 year ago

Same here, 17k assets, with about 2k geotagged.

When I open the map, it loads only ~200 assets, but I know there are a load more (I have seen them in the map before in previously). It keeps loading and the webUI freezes (I have to refresh or go to another page). I also noticed the "Storage" on the bottom left keeps loading and never finishes on the map page. When I refresh into the timeline, it works fine again.

On mobile it behaves the same way, although if I select only "Show Favorite Only", it works perfectly.

2023-09-28-102703_998x804_scrot

2023-09-28-102847_647x486_scrot

dodg3r commented 11 months ago

I think I'm experiencing the same problem. My wife has 130,000 photos and when she logs in the ui hangs If you are quick and click on e.g. people, you can make it not hang. If you go back to photos, it hangs again. I can also see that my browser eats up my ram. There is no load on the server.

If I login with my user that has about 30 000 photos then it works and is fast and no delays what so ever.

jrasm91 commented 11 months ago

I'm guessing you may have some bad data that is causing an issue.

Specifically, the network request to load gps data will probably contain assets with null.

dodg3r commented 11 months ago

Ok. I have the heap out of memory issue as well so I followed your advice emptying geocoding folder without success. How do I proceed with this? Should I start a new issue?

jrasm91 commented 11 months ago

This issue is for tracking the map rendering being slow with lots of assets. Unrelated to that is the map not working because of bad data. Also unrelated is the microservices container running out memory and crashing. Those are three separate and independent issues. Yes, you can open a new issue for the bad data in the map, since there are already existing issues for the other two.

jrasm91 commented 10 months ago

Is this still an issue with the new map provider?

HarHarLinks commented 10 months ago

My map is writing fine now, but I don't have "a lot of assets" compared to some other reporters.

klejejs commented 10 months ago

@jrasm91 Thanks for the improvements! The web experience is much smoother now and the map loads very quickly. On mobile, it works OK as soon as it loads, but it still takes about 10-15secs to do that.

jrasm91 commented 10 months ago

Yeah it is still all rendered clientside.

klejejs commented 8 months ago

Thanks for the map improvements! In the latest release on mobile the map now loads in much quicker. Unfortunately, another issue appears now - every time I try to move the map, or zoom it, it hangs for about 10secs before compleating the action.

shadowempire123 commented 7 months ago

Hi, having the same issues but way worse. Map on app hangs for ~2 minutes, scrolling, zooming -> app hangs for ~2 minutes -> actually unusable

~200.000 assets immich 1.96.0 in docker on QNAP TS-646 iphone app 1.96.0

shadowempire123 commented 3 months ago

Hi, having the same issues but way worse. Map on app hangs for ~2 minutes, scrolling, zooming -> app hangs for ~2 minutes -> actually unusable

~200.000 assets immich 1.96.0 in docker on QNAP TS-646 iphone app 1.96.0

same behaviour on: iPhone 15 Pro Max immich mobile app 1.107.1 immich server v1.107.2 hosted on qnap ts-664 (docker)

philjak commented 1 month ago

I can confirm. I have the latest version of Immich running (app and server). I got 170k assets, most have GPS data.

The app freezes if the zoom factor captures too many clusters (what’s always true when initially going to the map since the whole world map is shown). It hangs for a few minutes and the iPhone and iPad get very hot.

Thanks for taking care!

dJani97 commented 1 week ago

Same here with two separate instances of the latest Android app and the latest server, both producing the same error. About 100k assets each.