If you have the downloadable license and your website receives a significant amount of traffic, resulting in high server load, your system performance may be impacted. To address this, it is recommended to use a cron job for transaction processing. (See your merchant panel: Tools > Integration > Cron Job Integration.) Cron job processing operates as follows:
- The time interval set for the cron job determines how often the system processes all transactions.
- Processing is divided into two distinct sections.
- In the first cycle, the application processes pending emails.
- In the second cycle, the application processes transactions. This loop continues indefinitely.
For example, if your cron job is configured as follows:
*/2 * * * * /usr/local/bin/php -q /home/public_html/pap/scripts/jobs.php
This means that on even minutes, the system processes emails, and on odd minutes, it processes transactions.
In special cases where server load is exceptionally high, you can configure the system to process multiple cron jobs simultaneously. Here is a guide on how to achieve this:
First, copy the original cron job line and paste it below the original. Then, append the following flag to the first line:
--exclude Pap_Tracking_Visit_Processor
and this flag to the duplicate:
--include Pap_Tracking_Visit_Processor
Based on our example, your crontab should now look like this:
*/2 * * * * /usr/local/bin/php -q /home/public_html/pap/scripts/jobs.php --exclude Pap_Tracking_Visit_Processor */2 * * * * /usr/local/bin/php -q /home/public_html/pap/scripts/jobs.php --include Pap_Tracking_Visit_Processor
- Next, duplicate the scripts/jobs.php file in your filesystem and rename it, for example, to jobs2.php.
Finally, create a similar cron job for jobs2.php using only the include tag, like this:
*/2 * * * * /usr/local/bin/php -q /home/public_html/pap/scripts/jobs2.php --include Pap_Tracking_Visit_Processor
If you require additional parallel processing, simply create a new cron job line for each duplicate of the jobs.php file:
*/2 * * * * /usr/local/bin/php -q /home/public_html/pap/scripts/jobsX.php --include Pap_Tracking_Visit_Processor
That’s it. This configuration will improve system performance. Please ensure your database does not have any issues (such as insufficient space, corrupted tables, etc.), and that the cron interval matches the configuration—in our example, it is set to 2 minutes (*/2 * * * *).
The most convenient cron intervals are: 2, 4, 6, or 10 minutes.
Based on our testing, the most effective setup is to use 2 to 4 cron jobs.
Using more than this is generally not recommended, as you may need to decrease the cron interval to mitigate the server load generated by the cron jobs themselves.
If you are executing the jobs.php cron file via URL, you can use the following URL parameters:
- inclusion_type with values include or exclude
- inclusion_tasks for tasks to be included or excluded (comma-separated)
For example, the previous configuration using URLs would look like:
https://www.example.com/pap/scripts/jobs.php?inclusion_type=exclude&inclusion_tasks=Pap_Tracking_Visit_Processor https://www.example.com/pap/scripts/jobs.php?inclusion_type=include&inclusion_tasks=Pap_Tracking_Visit_Processor
Cron Runtime:
By default, cron executes for a maximum of 50 seconds. If you use the include/exclude parameters, execution time will be determined by the configuration under Tools > Cron Job Integration > Cron runtime.
To specify an exact maximum execution time, you can use the time parameter, e.g., time=25.
Example usage:
https://www.example.com/pap/scripts/jobs.php?time=25 https://www.example.com/pap/scripts/jobs.php?inclusion_type=exclude&inclusion_tasks=Pap_Tracking_Visit_Processor&time=25
This is useful when executing the cron via a web browser. Note that the browser timeout is typically 30 seconds (which is also the default timeout on our hosted servers).