You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate preview generation to async job execution #11685
The preview generation should happen using cron (preferably only the system cron) instead of happening on demand. - Currently we have a lot of users complaining about the performance just because preview generation is taking ages.
Actually, we should not remove the on-demand generation but add another cronjob that does the generation already before in some "common" sizes (i.e. retina and non-retina).
If the user visits the folder before the cronjob happened the on-demand generation would happen, otherwise the existing pre-generated thumbnails would be shown.
I'm not really sure how this would improve the user experience. A background job is not faster with generating the thumbnails neither is it done necessarily at the optimal time. I assume people keep on suggesting a background job because the old on demand generation was blocking the UI which is horrible. So perhaps we should wait if people are more happy with the behavior of 7.0.3
I agree with @karlitschek here. Let's wait for user-feedback from 7.0.3.
If people still experience performance issues with 7.0.3 this is definitely something we should consider for ownCloud 8.
a few things we should discuss when considering implementing this:
breadth-first or depth-first. (I'd vote for breadth-first)
sizes for caching: maybe also 1024x1024 for public sharing
Hi, first of all thanks a lot for considering the issue.
@karlitschek the problem is not the UI, but the preview generation.
I have just installed 7.0.3 and the UI itself is really quick. Good job. But the preview generation takes ages on slow machines (15 images take cca 2 minutes). I have a router running Openwrt (1200 MHz, 2GB RAM).
Background job is not faster. I agree. But once the process is over, all thumbnails are ready to be shown. And they do not have to be generated on-demand.
With the cron job, the user (server administrator) can decide when thumbnails are generated. Of course, it is difficult to choose optimal time. But it will be up to him to decide which time is optimal for the thumbnail pre-generation.
My suggestion:
create new php file, do not use existing cron.php for thumbnail pre-generation
the new php file would trigger preview generation for Gallery and for Files app
server administrator can schedule the preview generation using crontab
server administrator can set the priority of the thumbnail generation with nice
If the user visits the folder before the cronjob happened the on-demand generation would happen, otherwise the existing pre-generated thumbnails would be shown
Add a batch processing button for users so that they can upload all the pics from their camera, press the button and come back later to check the result. Users don't know when the cron job will run and are less likely to get frustrated with the gallery loading pictures slowly if they know they simply have to wait 30 minutes for all previews to get generated
As soon come to a conclusion regarding asnc file handling/job queing/etc thumbnail generation can make use of this as well. No specific implementation only for thumbnail operations. THX
Wondering if there's any updates on this subject? Preview is still painfully slow and sucks that thumbnails can't be generated "automagically" with a cronjob :(
@jonferreira see my suggestion #17916 from 2015, basically I was proposing to integrate another JPEG preview program which takes 3 sek instead of 3 min for my example digital photo on a weak CPU. Nothing has happened since :(
@nero120 the reason this was likely never incorporated back then is because the design goals of ownCloud was to be purely PHP to make sure that everyone can deploy this on their shared hosters, etc.
Now in 2019 I'm still unsure if / how to incorporate such external tool in a way to make it work from OC. Maybe it needs an OC app that is able to call it with shell_exec.
In any case, I don't think that's the right direction and we should stay in PHP-world to keep the easy of deployment for everyone.
This app implements the previews with fixed scales instead of expecting previews with every possible pixel size. So the viewer would pick the preview with the closest size instead of requesting a preview with the exact size from the server.
I think this is a good prerequisite for a future background job for preview generation, because said job could then simply build previews for all these fixed supported sizes.
Now I'm not aware of any timeline to provide such background job.
On server with 100k users it is likely that such background job would take ages to finish and consume a lot of CPU on many servers. So this needs careful consideration.
On server with 100k users it is likely that such background job would take ages to finish and consume a lot of CPU on many servers.
Whilst that may or may not be true (depending on whether the users on the server upload many high quality images), surely it's for the server admin to determine how best to spend the server's resources and that will depend on the hosting scenario. If you are an admin intending to provide users with a place to upload and share their photos then without preview generation this is not really fit for purpose.
I appreciate your point, but the risk can easily be mitigated by providing a preview generation job with parameters to enable admins to control when and how previews are generated. But I have to be honest, a cpu intensive task such as preview generation must be done in the background otherwise the experience is severely degraded whilst the user is forced to wait long moments every time they want to look at an image...
After 5-years, still a milestone of 'maybe someday' goal... I sincerely think the target of 'ownCloud' audience is loosing its plot along the way. I believe ownCloud is best suit target at the audience of people who choose not their data over public cloud offering, whether it Dropbox, LiveDrive, Sharepoint, etc. The reason can simply be, but not limited to:
Privacy reason
Decision over it should be opex (Cloud based) or capex (self host solution)
People who like more flexibility and control
I have so many self scenario that a simple OCC command line for admins to do background thumbnail generating at their own freewill will work out better than ondemand generation. For one, copy over the images manually (without OC), another sync mass images without the OC due to performance factors. Made a decision of sync over my Android phone using Folder sync, after 8000+ images, realize it was impossible to use now as ownCloud app can never finish generating the Thumbnail.
Regardless of which situation, this type of limit (and few others), really make me think the ownCloud target audience isn't for what aforementioned, but instead smaller Cloud reseller. What even puzzling me is, how NextCloud has implemented this nearly two years ago, and ownCloud is still considering to do this or not...
so instead of an OC bkg job this could be implemented as an occ command instead, which gives more freedom for admins to decide when to run them.
Any update on this? I think an occ command would be perfect. My small home server takes really long to generate the thumbnails, so browsing images through the web interface is really painful.
Activity
LukasReschke commentedon Oct 21, 2014
And yes, I know that this is not possible with encryption, but the cronjob could just check whether the instance is encrypted or not.
Just because there is one use-case where it doesn't work shouldn't prevent massive speed gains on other use-cases ;-)
LukasReschke commentedon Oct 21, 2014
Actually, we should not remove the on-demand generation but add another cronjob that does the generation already before in some "common" sizes (i.e. retina and non-retina).
If the user visits the folder before the cronjob happened the on-demand generation would happen, otherwise the existing pre-generated thumbnails would be shown.
karlitschek commentedon Oct 21, 2014
I'm not really sure how this would improve the user experience. A background job is not faster with generating the thumbnails neither is it done necessarily at the optimal time. I assume people keep on suggesting a background job because the old on demand generation was blocking the UI which is horrible. So perhaps we should wait if people are more happy with the behavior of 7.0.3
georgehrke commentedon Oct 21, 2014
I agree with @karlitschek here. Let's wait for user-feedback from 7.0.3.
If people still experience performance issues with 7.0.3 this is definitely something we should consider for ownCloud 8.
a few things we should discuss when considering implementing this:
LukasReschke commentedon Oct 21, 2014
Setting to ownCloud 8 and triaging. - Let's close this if nobody complains, if not let's see what we can do.
ronnicek commentedon Oct 24, 2014
@karlitschek it's easy.. set up Raspberry Pi /w Owncloud and load gallery with some photos :)
budulinek commentedon Oct 24, 2014
Hi, first of all thanks a lot for considering the issue.
@karlitschek the problem is not the UI, but the preview generation.
I have just installed 7.0.3 and the UI itself is really quick. Good job. But the preview generation takes ages on slow machines (15 images take cca 2 minutes). I have a router running Openwrt (1200 MHz, 2GB RAM).
Background job is not faster. I agree. But once the process is over, all thumbnails are ready to be shown. And they do not have to be generated on-demand.
With the cron job, the user (server administrator) can decide when thumbnails are generated. Of course, it is difficult to choose optimal time. But it will be up to him to decide which time is optimal for the thumbnail pre-generation.
My suggestion:
oparoz commentedon Nov 24, 2014
DeepDiver1975 commentedon Nov 25, 2014
As soon come to a conclusion regarding asnc file handling/job queing/etc thumbnail generation can make use of this as well. No specific implementation only for thumbnail operations. THX
73 remaining items
nero120 commentedon Nov 30, 2018
That is a very welcome statement @PVince81! Any idea on when we might be able to expect it?
jonferreira commentedon Feb 12, 2019
Wondering if there's any updates on this subject? Preview is still painfully slow and sucks that thumbnails can't be generated "automagically" with a cronjob :(
fungs commentedon Feb 12, 2019
@jonferreira see my suggestion #17916 from 2015, basically I was proposing to integrate another JPEG preview program which takes 3 sek instead of 3 min for my example digital photo on a weak CPU. Nothing has happened since :(
nero120 commentedon Feb 12, 2019
@PVince81 are you able to incorporate @fungs solution into your reworking of the preview system?
jonferreira commentedon Feb 12, 2019
@fungs :(
PVince81 commentedon Feb 12, 2019
@nero120 the reason this was likely never incorporated back then is because the design goals of ownCloud was to be purely PHP to make sure that everyone can deploy this on their shared hosters, etc.
Now in 2019 I'm still unsure if / how to incorporate such external tool in a way to make it work from OC. Maybe it needs an OC app that is able to call it with
shell_exec.In any case, I don't think that's the right direction and we should stay in PHP-world to keep the easy of deployment for everyone.
Currently we're reworking the frontend and integrating both the video player and slideshow view into a single app, see https://github.com/owncloud/files_mediaviewer (release coming soon).
This app implements the previews with fixed scales instead of expecting previews with every possible pixel size. So the viewer would pick the preview with the closest size instead of requesting a preview with the exact size from the server.
I think this is a good prerequisite for a future background job for preview generation, because said job could then simply build previews for all these fixed supported sizes.
Now I'm not aware of any timeline to provide such background job.
On server with 100k users it is likely that such background job would take ages to finish and consume a lot of CPU on many servers. So this needs careful consideration.
@pmaier1
elpraga commentedon Feb 12, 2019
Finally!! Set preview sizes!! Finally!
nero120 commentedon Feb 13, 2019
Thanks for your comments @PVince81.
Whilst that may or may not be true (depending on whether the users on the server upload many high quality images), surely it's for the server admin to determine how best to spend the server's resources and that will depend on the hosting scenario. If you are an admin intending to provide users with a place to upload and share their photos then without preview generation this is not really fit for purpose.
I appreciate your point, but the risk can easily be mitigated by providing a preview generation job with parameters to enable admins to control when and how previews are generated. But I have to be honest, a cpu intensive task such as preview generation must be done in the background otherwise the experience is severely degraded whilst the user is forced to wait long moments every time they want to look at an image...
PVince81 commentedon Feb 13, 2019
so instead of an OC bkg job this could be implemented as an occ command instead, which gives more freedom for admins to decide when to run them.
tribut commentedon Feb 13, 2019
See also https://apps.nextcloud.com/apps/previewgenerator, which adds an occ command for this (Nextcloud).
TNCS-git commentedon Dec 22, 2019
After 5-years, still a milestone of 'maybe someday' goal... I sincerely think the target of 'ownCloud' audience is loosing its plot along the way. I believe ownCloud is best suit target at the audience of people who choose not their data over public cloud offering, whether it Dropbox, LiveDrive, Sharepoint, etc. The reason can simply be, but not limited to:
I have so many self scenario that a simple OCC command line for admins to do background thumbnail generating at their own freewill will work out better than ondemand generation. For one, copy over the images manually (without OC), another sync mass images without the OC due to performance factors. Made a decision of sync over my Android phone using Folder sync, after 8000+ images, realize it was impossible to use now as ownCloud app can never finish generating the Thumbnail.
Regardless of which situation, this type of limit (and few others), really make me think the ownCloud target audience isn't for what aforementioned, but instead smaller Cloud reseller. What even puzzling me is, how NextCloud has implemented this nearly two years ago, and ownCloud is still considering to do this or not...
nagelp commentedon Aug 18, 2020
Any update on this? I think an occ command would be perfect. My small home server takes really long to generate the thumbnails, so browsing images through the web interface is really painful.
hast0011 commentedon Aug 18, 2020
micbar commentedon Sep 16, 2021
This will be implemented in the future in ocis. Closing here.