Slow creation of thumbnails - 121 seconds per picture

Phoca Gallery - image gallery extension
RunAndBike
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 08 Jan 2023, 15:45

Slow creation of thumbnails - 121 seconds per picture

Post by RunAndBike »

Hello,

I upload new pictures to the gallery two to three times a year. Each time between 400 and 2000 pictures. Normally it takes about one to two seconds per image to create the three thumbnails. Today I uploaded 400 images again, and now it takes 121 or 122 seconds to create the three thumbnails for each image. When I stop thumbnail generation, it takes the up to two minutes, until the process stops and I can get back into the Images-View. When I enable thumbnail generation, the three thumbnails are created right away, but then there is a "pause" for the two minutes.

https://i.imgur.com/W1hdk5G.png

Joomla is version: 3.10.11
Phoca Gallery was a version from August 2019. After the error occurred, I updated to the current version 4.4.3, without change

Currently I have no idea where this delay comes from. It's a managed server at a hoster, so I can't check much on this site.

In June 2022 it worked as expected. I haven't found anything on the forum in the last few pages that anyone has had similar issues lately. Do you have any idea where this delay could come from?

Thanks and best regards,
Christian

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slow creation of thumbnails - 121 seconds per picture

Post by Jan »

Hi, do you get the same problem when enabling pagination thumbnails creating?

https://www.phoca.cz/documents/2-phoca- ... em-solving

Jan
If you find Phoca extensions useful, please support the project
RunAndBike
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 08 Jan 2023, 15:45

Re: Slow creation of thumbnails - 121 seconds per picture

Post by RunAndBike »

Hello Jan,

Yes, I have tried all combinations of "Pagination Thumbnail Generation" and "Enable Thumbnails Generation". Also with and without "Additional Thumbnails" and "Crop Thumbnails" in different forms. It's always the same result. The strange thing is that it is always the same long duration between the images. Therefore I don't believe in a resource problem, but of course I can't exclude it.

The images have all been created in the meantime. Just very slowly.

I deleted a handful of thumbnails in an old folder (different category), where I know that the thumbnails were created normally fast the last time. The first 9 were created again directly within one second. Then again 122 seconds pause, then 3 images, 122 seconds pause, 3 images and so on.

https://i.imgur.com/PzudxWw.png

Edit: and I also tried different browser (Edge without any AddOns, FireFox, Chrome), different PCs in different networks, turned of virus scan and so on. If you have any idea what else I could check, please let me know.

Thanks for your support,
Christian
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slow creation of thumbnails - 121 seconds per picture

Post by Jan »

Hmm, really hard to say what can be wrong.

Mostly, if there is some long way on server, with pagination thumbnail generation this can be very easily detected.

E.g. this option is enabled and only 5 images per page is displayed on the site, then checking only these 5 images should really not take so much time.
Another problem can be some issue with redirect but mostly this will be not the same for all different browsers :idea:

Jan
If you find Phoca extensions useful, please support the project
tim_misurina
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Sep 2023, 21:08

Re: Slow creation of thumbnails - 121 seconds per picture

Post by tim_misurina »

Hi Jan,

I observe similar issues.
Thumbnail generation has become slower and slower over time.
I also have option "Enable Thumbnails Generation" set. Now that there are over 15,000 uploaded images in my installation, thumbnail generation seems to pause for approx. 30 seconds before the thumbnail triplet for the next image is created.

Out of curiousity I moved most subdirectories with images out of the phocagallery base directory, so that only a few hundred images were still in the phocagallery directory. And - ta da - thumbnail generation was as fast as it was years ago.

So my strong assumption how the thumbnail generator works is:
whenever the thumbnails for one image have been created, the thumbnail generator checks all files within the phocagallery base directory to find the next image to process. Which takes some time.
And the more images there are, the slower this process gets.

Could this be the case?
If yes, would there be a chance to make the thumbnail generator just a little bit smarter?

Thanks for your great extension,
and thanks for the time you spend on it,
Tim
christine
Phoca Hero
Phoca Hero
Posts: 2738
Joined: 28 Nov 2010, 17:20

Re: Slow creation of thumbnails - 121 seconds per picture

Post by christine »

Hi Tim,
tim_misurina wrote: 24 Sep 2023, 21:17
whenever the thumbnails for one image have been created, the thumbnail generator checks all files within the phocagallery base directory to find the next image to process. Which takes some time.
Hope, this could help you:

Image

Image

Kind regards
Christine
tim_misurina
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Sep 2023, 21:08

Re: Slow creation of thumbnails - 121 seconds per picture

Post by tim_misurina »

Hi Christine,

thanks a lot for you quick answer.
The effect of your suggested setting is: thumbnails are created on demand - whenever a user paginates through an image gallery.
Do I understand this right?

Unfortunately this has never worked for me and still doesn't (earlier on Joomla 3, now on 4).
That's why I changed my settings to prebuild the thumbnails with "Enable Thumbnails Generation" = "Yes".

Is there anything I can do to to diagnose why the "Pagination Thumbnails Generation" has no effect on my installation?
I'm running PhocaGallery 4.5.4 on Joomla 4.2.9.

Best regards and thanks again,
Tim
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slow creation of thumbnails - 121 seconds per picture

Post by Jan »

Hi, what exactly of problem do you get when using pagination thumbnails creation?

Jan
If you find Phoca extensions useful, please support the project
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9123
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Slow creation of thumbnails - 121 seconds per picture

Post by Benno »

Hi,
Do I understand this right?
No!
Meant was the pagination in the backend.
If you have set: 'Pagination Thumbnail Generation=Yes' in Phoca Gallery Options as in Christine's first screenshot, in: Backend --> Components --> Phoca Gallery --> Images
only the thumbnails for 20 images will be generated (if you have set the pagination there like that - see Christine's second screenshot). So no more for all images at once. This takes a lot of load off the system and usually speeds up the process.

Kind regards,
Benno
tim_misurina
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Sep 2023, 21:08

Re: Slow creation of thumbnails - 121 seconds per picture

Post by tim_misurina »

Hi Benno,

you fixed my wrong expectation and saved my day :)
Thanks a lot!!

It's all about pagination in the backend (administrator), i.e. in the "Components::Phoca Gallery::Images" view.
I previously had a wrong expectation, I thought this affects thumbnail generation "on demand" in the frontend (site), i.e. when viewing phoca image galleries.

@Jan: Benno's response has solved my problem. Thank you for trying to help.

BR,
Tim
Post Reply