-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
previews:cleanup issues #40383
Comments
I ran the command again to check:
The instance is small, it took 11h... the chunksize was set to 1, it processed 2 😱 |
On request of @DeepDiver1975 Query:
Result:
|
looks like 372k rows are processed ...... this could explain things .... |
It's normal behavior to remove all files will take time. The command is to remove all previews, this is only needed if you want to turn off the previews. additional parameter is needed in the config.php |
|
This is a special command only needed to remove all previews. administrators do not need to run this command at all! Please don't use it if you don't have a problem with previews, DB performance, and other apps that are involved in this issue., the command is not optimized and is not expected to optimize the performance. If people want to use it then they will need assistance from oC-Support. |
this is wrong @cdamken In regular operations NO preview will be removed during deleting files/folders. |
Needs assessment and improvement. |
@DeepDiver1975 based on the GO from Patrick above, could you have a look for improvements? |
Hello, I think this should fix it (not tested very well, but should have the same result) : select `fileid`, `name`, `user_id` from `oc_filecache` `fc`
join `oc_mounts` on `storage` = `storage_id`
where `parent` in (select `fileid` from `oc_filecache` where `storage` in (select `numeric_id` from `oc_storages` where `id` like 'home::%' or `id` like 'object::user:%') and `path` = 'thumbnails')
and `fc`.`fileid` not in (select `fileid` from `oc_filecache` where `fc`.`name` = CAST(`oc_filecache`.`fileid` as CHAR(24)))
and `fc`.`fileid` > '0'
order by `user_id`, `fileid` limit 10;
Now the query runs in < 1s |
@DeepDiver1975 can you have a look ob the suggested change? |
refs #40514 |
Important, files and database are on a fast NFS (NetApp) backend connected via GbE. Enterprise server running VMWare as host for ownCloud.
Steps to reproduce
occ previews:cleanup
without any options/argumentsPost successful upgrading, started
occ previews:cleanup
without any options/arguments. This means it should make one round with max 1000 entries (chunks) which is the default. The command started at 18h and did not finish until 23h. Rechecking in the moring, ist finished and reported1103 orphaned previews deleted
. Means it took between 4 and 11h... (remember, it is only a small instance started many years ago). Runninghtop
in a second shell, memory is fine, mariadb takes 1-2 cores with 100%.Following findings:
OCA\Files\BackgroundJob\PreviewCleanupJob
Required Solutions:
-- improve performance
-- respect the chunksize
-- add the bg job to the table automatically when upgrading (migration step necessary?)
-- improve command responsiveness (maybe to add a progress option, a timestamp how long it took)
@DeepDiver1975 @pmaier1 fyi
@jnweiger
Referencing feat: previews are physically deleted from disk and db in an async manner
Server configuration
Operating system: U22.04
Web server: nginx
Database: mariadb
PHP version: 7.4
ownCloud version: 10.11
Updated from an older ownCloud or fresh install: yes
Where did you install ownCloud from: tar
Signing status (ownCloud 9.0 and above): all good
ownCloud log (data/owncloud.log)
nothing relevant
The text was updated successfully, but these errors were encountered: