I've found myself with a queue of over 195k adhoc tasks in the mdl_task_adhoc table.
The cronjob is getting stuck slowly processing the queue to the detriment of all other adhoc and scheduled tasks.
The way I currently run cronjobs is to allow only one instance at a time - I create a lock file.
I will change that so that multiple crons will be able to run, but am concerned that I'm just going to load up apache with loads of cronjobs stuck on my enormous list of adhoc tasks.
I'm thinking of using timeout on the cronjob just to kill it and restart again
*/5 * * * * timeout 600 php /var/www/html/admin/cli/cron.php
Has anyone tried this? Any issues with doing this?