Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial face preview generation hang Nextcloud #193

Closed
Petahh opened this issue Nov 29, 2019 · 8 comments
Closed

Initial face preview generation hang Nextcloud #193

Petahh opened this issue Nov 29, 2019 · 8 comments

Comments

@Petahh
Copy link

Petahh commented Nov 29, 2019

Hello All, when I access the recognized face those little square previews of faces start to load for the very first time, often the whole instance of Nextcloud freeze.

I'm using debian/apache version of Nextcloud with MariaDB, Redis with 4GB of RAM.

So I found that when I go line by line it loads in mannered fashion, but If I maximize and it tries to load all of the previews at once (for the first time) it works only unlit eats all the memory then hangs. Is there any way how to pace these previews or pre-generate all manually?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Petahh Petahh changed the title Face previews are slow and often hang Nextcloud Initial face preview generations hang Nextcloud Nov 29, 2019
@Petahh Petahh changed the title Initial face preview generations hang Nextcloud Initial face preview generation hang Nextcloud Nov 29, 2019
@matiasdelellis
Copy link
Owner

Hello @Petahh
You're right, today we don't have any cache implementation.

We originally intended to use the browser cache, but having the faces of all your photos in the browser can be questionable..

As you observed, they are dynamically loaded as you move the viewport, but the faces are so small that you easily have 100 faces in sight at all times (This is 100 calls in parallel to your server). and if you scroll to the end of the page, it will try to load all your faces, which can be an important load for your server.

In principle, I never wanted to cache the server side because I think that this view should not exist (It would be for a long discussion 😉 ), and writing millions of small images on your disk, also would be an important load for your server, since writing to disk is even more expensive..

Well, we currently use Lozad.js to load the images dynamically. My first idea would be to look for an alternative that limits the loading of images to a certain number in parallel, but of course it is not a real solution to the problem.

it works only unlit eats all the memory then hangs.

Sorry for that! 😓

@Petahh
Copy link
Author

Petahh commented Nov 30, 2019

No worries @matiasdelellis , I managed to generate all by slowly scrolling down in small window. Now it works like charm. It’s something which definitely needs to be improved for future.

@matiasdelellis
Copy link
Owner

Although it is difficult, if it advances, we can do something similar ..

nextcloud/server#18210

@GAS85
Copy link

GAS85 commented Jun 22, 2020

Why not to use standard Previews folder of Nextcloud and just added there face1.jpg, face2.jpg? There is a 1 Folder per picture with different previews.

Or create new - own face previews folder. E.g. .../face-previews/file ID in a DB or internal link/faceXXXXXX.jpg

@matiasdelellis
Copy link
Owner

Hi @Petahh @GAS85
I have been working to eliminate the face view, in favor of an photos view reusing Nextcloud thumbnails, and it could dramatically help with this problem.. See # 433, I would appreciate tests and comments.. 😄

@GAS85
Copy link

GAS85 commented Oct 13, 2020

Could't find anything under #433...

@matiasdelellis
Copy link
Owner

Sorry.. 😅
#336

@matiasdelellis
Copy link
Owner

The load is still high in some parts, but as for this report, I consider it fixed in last release..

Thanks for everything!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants