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

occ is slow and doesn't support an internal batched mode #11275

Closed
robert-scheck opened this issue Sep 18, 2018 · 2 comments
Closed

occ is slow and doesn't support an internal batched mode #11275

robert-scheck opened this issue Sep 18, 2018 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: occ Nice to have

Comments

@robert-scheck
Copy link
Contributor

As of Nextcloud 14.0.0, occ is still slow and it also does not support an internal batched mode or similar:

$ time ./occ --no-interaction app:disable richdocuments
richdocuments disabled

real	0m0.714s
user	0m0.537s
sys	0m0.166s
$ 
$ time ./occ --no-interaction app:enable richdocuments
richdocuments enabled

real	0m0.933s
user	0m0.627s
sys	0m0.188s
$ 
$ time ./occ --no-interaction app:disable password_policy
No such app enabled: password_policy

real	0m0.736s
user	0m0.561s
sys	0m0.160s
$ 
$ time ./occ --no-interaction maintenance:update:htaccess
.htaccess has been updated

real	0m0.727s
user	0m0.555s
sys	0m0.158s
$ 
$ time ./occ --no-interaction background:cron
Set mode for background jobs to 'cron'

real	0m0.717s
user	0m0.534s
sys	0m0.172s
$ 
$ time ./occ --no-interaction maintenance:mode --off
Maintenance mode already disabled

real	0m0.848s
user	0m0.645s
sys	0m0.190s
$ 
$ time ./occ --no-interaction integrity:check-core  

real	0m2.395s
user	0m1.716s
sys	0m0.643s
$ 
$ time ./occ --no-interaction db:add-missing-indices
Check indices of the share table.
Done.

real	0m0.899s
user	0m0.603s
sys	0m0.177s
$ 

From my point of view the bad performance of occ is caused due to PHP interpreter being loaded including all Nextcloud classes etc. Thus I would like to suggest an internal batched mode which could look like this:

$ ./occ config:batch /tmp/commands.txt
richdocuments disabled
richdocuments enabled
No such app enabled: password_policy
.htaccess has been updated
Set mode for background jobs to 'cron'
Maintenance mode already disabled
Check indices of the share table.
Done.
$ 
$ cat /tmp/commands.txt
app:disable richdocuments
app:enable richdocuments
app:disable password_policy
maintenance:update:htaccess
background:cron
maintenance:mode --off
integrity:check-core
db:add-missing-indices
$ 

Note that config:batch is not intended as dumb shell script-like functionality that calls occ per line, but one single occ call where all commands are handled internally one after each other without having the need to re-load the PHP interpreter and the Nextcloud classes. I expect a nice speedup of occ using such a functionality.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #11274 (occ doesn't support enabling/disabling multiple apps at once), #3301 (Unsetting maintenance mode using occ doesn't work), #8275 (fseek(): stream does not support seeking at *** with S3), #9949 (Warning when disabling maintenance mode using occ), and #6412 (occ files:scan -all does not scan saml users).

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Aug 20, 2020
@skjnldsv
Copy link
Member

skjnldsv commented Sep 9, 2020

As this sounds like a nice feature, the requests for this are quite low. Currently there a no plans to implement such a feature. Thus I will close this ticket for now. This does not mean we don't want this feature, but it is simply not on our roadmap for the near future. If somebody wants to implement this feature nevertheless we are happy to assist and help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: occ Nice to have
Projects
None yet
Development

No branches or pull requests

5 participants