Over the past few months, in our Moodle 2.6.3 installation, we have noticed a steady increase in the amount of time that it takes the admin cron to finish running, and in our investigations, the cron always seems to hang up when it calls completion_cron_completions() within /completion/cron.php. Especially in our case, it makes sense, since it's having to process completion for ~200,000 records, one at a time (we have 12,000 users who have open access to ~300 eLearning courses). This process is now taking up to three hours at a time to run, and while we've engineered a customized script to replace it (running in 4-5 minutes for the same amount of records), our tests have shown that this script isn't actually updating anything.
This, of course, leads to the question of whether or not the completion cron is necessary at all, so I thought I'd ask:
In Moodle 2.6.3 (and above), what purpose does the completion cron serve, and what does it do? Why is it there, when completion data appears to be updated for a user in a course in real-time? What impact would we see if we spaced it out to only run daily, or separated it into its own server process? Is it a bad idea to disable?