pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
3.18k stars 86 forks source link

perf: shared albums are slow #753

Open pulsejet opened 1 year ago

pulsejet commented 1 year ago

Reported at Discord: https://discord.com/channels/1100157156742926406/1100158171621904567/1134462269523230740

public shared album
everything works very well and smooth for logged users
but UI and thumbnail loading gets extremely slow when accessing the album using the public link
as a logged in user, even clicking on the share button causes a loading window for a minute or so, and in the server I can see this

image

y0grt commented 1 year ago

more info Nextcloud 27.0.1.2

clicking on the share button from an album causes a modal to freeze loading for a minute or show, with postgres showing a high CPU consumption image

using a public link to the folder (containing all the pics in the album) shows the same behavior.. high cpu usage and lazzy thumbnail loading previews seems to be well generated, since Memories app loads instantly the whole album

johnhelt commented 1 year ago

not seeing this on my docker-compose setup (nextcloud 25.0.6 (php-fpm), using mariadb and redis) running memories 5.2.1. I checked through incognito and public link on memories behind a vpn (no local ethernet traffic), with lightning fast speeds.

y0grt commented 1 year ago

@johnhelt how large is your folder? just realised that anything related with public shares is extremly slow in my server, causing postgresql db to eat all the CPU. I've tried disabling suspicious login app, and bruteforce protection, but still no clue about what is causing this.

pulsejet commented 1 year ago

This likely has to do with the fact that all photos are of the same day. Just needs more optimization or faster hardware at this point.

y0grt commented 1 year ago

solved by nuking oc_filecache and rebuilding the index, something was bloating the database. sorry for blaming Memories.

pulsejet commented 1 year ago

Great! I'm gonna keep this open for a different reason: the sharing dialog loads the entire album when it shouldn't. This is a bug in the Photos DAV API.

y0grt commented 1 year ago

yeah I can see some delay with a 1600 pics album (nothing like before tho). edit album button has the same delay btw.

ChildLearningClub commented 1 year ago

So it was the cobwebs on the database :). So the oc_filecache caches shares but not what is presented to logged in users? I would think it would cache both for speed?