Attention! Provided settings are listed outside the scope of the Virtual Appliance menu. This means that the details below are provided for informational purposes only and should be used with clear understanding of your actions and under your own liability. Bitrix24 technical support reviews the questions related to Virtual Appliance menu items only.
Moving agent to cron
In large or medium-sized projects, sometimes there is an issue with the transfer of especially heavy agents to Cron.
First, fully disable execution of agents on a hit. To do this, the command /bitrix/admin/php_command_line.php?lang=en should be executed in PHP-console of Bitrxi24 product administrative menu:
After that, all agents and forwarding of system Messages will be processed under cron, once each 1 minute.
Note: Cron failing to execute after the command means you have errors in your project. These errors, most likely, are not agent-related. Look for them in the PHP logs. You can enable an extended error display in .settings.php.
Email message queue
The parameter responsible for the quantity of e-mail messages, processed at once, must modified to prevent a large of e-mail messages queue. To do that, execute the following command in PHP-console:
When a regular cron_events.php was launched before completing previously triggered script, agents will fail to launch and script terminates (due to agents being blocked during execution time). In this case, processing is no different from processing on a hit; a new hit can occur at the moment, when agents failed to execute on the previous hit.
Usually, scripts, executed under cron do not have limits on execution time. However, using database-handling methods in scripts can encounter an error with executing embedded scripts. To avoid this error, you can modify the value in /bitrix/php_interface/dbconn.php:
// when script is executed by cron, database connection limit is: 600 seconds, otherwise - 60
@set_time_limit(php_sapi_name() == "cli" ? 600 : 60);