Due to the bug described in MDL-63260, we have a couple of hundreds of thousands of orphaned questions in our database, and a couple of courses which contain more than 100k questions and are thus very unresponsive.
To see if an Upgrade from 3.6.1 to 3.6.2 would fix this, I tried importing one such course to our test system, resulting in an additional 300k questions listed in the database in mdl_questions.
I then upgraded the system to the latest build of 3.6.2+ released today.
Trying to run the question cleanup task from the CLI as described in MDL-63260, does not work for me:
/var/www/moodle# php admin/tool/task/cli/schedule_task.php --execute=\\qtype_random\\task\\remove_unused_questions
Task '\qtype_random\task\remove_unused_questions' not found
The first time when I try to run the task via CLI it also reports:
Resetting core_component cache after core upgrade to version 2018120301
So I set the scheduled task to run every minute, set the cron to run every minute, and let it do its job for around 2 hours.
Right now, this does not seem to work - only around 30k questions have been deleted from the db in the first run, and ever since, additional runs of the task via cron do not delete a single question from the db. Periodically I get an e-Mail from the cron job with one word: "Killed."
If i look into the scheduled tasks it never logs a run of the "Remove unused random questions" tasks any more, the "last run" time keeps unchanged no matter how often I run the cron, and the "Next run" is stuck at "ASAP".
Also, the cleanup task does not really seem to be executed at all when I execute cron directly via web.
I tried purging all caches, but that does not help either. I will keep the settings of "run once every minute" for both the cron and the scheduled cleanup task over the weekend, but my hopes that anything changes are rather low...