11/10/2016

Trigger deferred.php Via Shell Crontab

I had an issue where the deferred.php script was being called 400-500 times per minute by the normal method where end user activity triggers it. This will move the deferred.php triggering to a crontab job run in the shell by your server in an automated (and more controllable) fashion.



First, remove the deferred trigger from the PAGE_CONTAINER template. Simply remove this from that template:
Code:
{xen:if $hasAutoDeferred, RunDeferred}
Second, create a file in your /etc/cron.d/ folder on your server (you can name it whatever you want... in my case, it's "xenforo_deferred") with the following contents:
Code:
* * * * *       root    /path/to/your/php /path/to/your/site/deferred.php > /dev/null 2>&1
Make sure you specify the full path to your PHP executable as well as your deferred.php file in that file.

That will have the system trigger the deferred.php once per minute (a huge improvement of multiple times per second in my case).

I wish you success.

Source: xenforo.com​

Không có nhận xét nào:

Đăng nhận xét