- Compatible XF Versions 2.x
- 2.0, 2.1
This addon requires PHP 5.4 or higher and only works on XenForo 2.0.x
Install as per normal addon installation.
Note: once this addon is installed and activated, scheduled tasks will no longer run - so completing the remaining installation steps is critical to ensure your forum continues to function normally.
First, you should test that your job runner is functioning - execute the following command from your CLI:
/srv/www/xenforo/community, then the job runner command would be:
-q) flag to suppress output.
Once you are happy that the job runner functions, you will need to create your own cron task to run it on a schedule of your choosing.
It is highly recommended that you have your cron task run as the web server user to prevent potential permission problems.
For example, on Ubuntu with a web server user of www-data, install a cron task by running the following command:
This will execute the job runner every minute, checking for outstanding jobs to be run.
By default, the job runner will run for a maximum of 30 seconds, executing any outstanding jobs until there are no more runnable jobs in the queue.
You may adjust the maximum execution time of the job runner by specifying the
--time=[TIME]option on the command line.
For example, to allow the job runner to execute for a maximum of 45 seconds:
If you prefer to not run the cron task as frequently as once per minute, you can adjust the cron job as
required and if you do, you may also want to allow the job runner task to run for longer than the default 30 seconds to ensure that all outstanding work is completed.
For example, to run the cron task every 5 minutes, allowing the job runner to execute for a maximum of 4 minutes, use the following cron command:
This is configured via a XenForo config.php Option:
jobMaxRunTimeoption configures the amount of time in seconds that processing jobs will be allowed to run before they are suspended for further processing on another go-around, if possible. The default setting is optimised for the browser-triggered job runner and so to allow jobs to execute longer in a CLI environment, you may want to adjust this to a higher value.
You should not set
jobMaxRunTimeto anything higher than 30 seconds, or the time specified by the --time option. In general it is suggested that this setting be kept to a relatively small value to avoid the situation where a single very long job may prevent other jobs from executing in a timely manner. Some experimentation may be required to find the optimal value for your server load and forum size.