To improve performance in Drupal, we recommend disabling the built-in cron system in Drupal and run cron on the server side instead. This will offload the website and may cause significant improvements to the TTFB (Time to first Byte).
Time needed: 2 minutes.
Here’s how to setup cron the right way with Drupal.
- Disable Drupal built-in cron system
settings.phpfile for your Drupal website and add the following line:
$conf['cron_safe_threshold'] = 0;
- Setup cron in our Control Panel
Go to the settings page for your website in our Control Panel. Enter the following in the field for time:
*/10 * * * *
This will make the cron job run once every 10 minutes. In the command field, enter this command:
drush --root=/kunder/group/user/public/ --uri=yourdomain.com --quiet cron
Note: you need to replace the root-parameter with the complete path to your folder and the uri-parameter with your domain name. You can find this in the site settings inside your Servebolt Control Panel.
Click the “Add” button and the cron job will be saved.
- Configure email notifications
If you don’t want to receive emails when your cron jobs have been executed, select the (newly created) cron job in the list of this page and, in the drop-down box below, select “Do not send email”. Click the “Update” button in the bottom of the page.
You may still receive email messages regarding cron jobs if an error occurred during the execution of the cron. To get rid of these emails, you will need to fix the code that is related to the errors.
Give us your feedback on this article
Servebolt has launched Accelerated Domains!
Accelerated Domains is a service that greatly improves and optimizes your site on these four areas: Performance, Scalability, Security and the Carbon footprint of your website.