I have a Mobile APP with a Drupal 8 admin backend and I have almost 20 cron jobs running at least 15 times on the day. I'm using Ultimate Cron and Advanced queue modules for handling this. I know that to ensure that all crons running properly, the website should be opened at least once a day or make the crons on the server not on the Drupal site. But, my solution is to create one cron job on the server hitting the website base url to just ensure that all crons will run. So, my question is, does this solution work?
2 Answers
Maybe.
Considering there are 20 cron jobs and they all run 15 times a day and you’re using advanced queue, I would make sure to test in your production environment timeouts and memory issues.
Personally I would use cron + drush making sure the php.ini
for command line PHP has more than enough resources to accommodate whatever it is you’re doing.
drush cron-run
https://cgit.drupalcode.org/ultimate_cron/tree/ultimate_cron.drush.inc?h=8.x-2.x#n77
-
Thanks For your reply. I've tested on the production and I think all cons running properly, but I got on the logs "No free threads available for launching jobs", I've searched for how to solve this and cannot reach to a solution. BTW, when I tested the crons manually I found that it's working great Commented Sep 30, 2018 at 14:39
If your site is relying so much on Cron you should NEVER trigger it by a user request as this can lead to ruin the user experience.
I don't know what OS you are using but here is a helpful howto for settings up cron jobs in Ubuntu.