Z
Z
Zikdelk2021-07-12 15:26:40
PHP
Zikdelk, 2021-07-12 15:26:40

When checking the system for performance, the file /home/bitrix/www/bitrix/modules/main/tools/cron_events.php gives a load. How to reduce the load?

When checking the system for performance, the file
/home/bitrix/www/bitrix/modules/main/tools/cron_events.php gives a load 95.90% 2 0.7897

How to reduce the load of this file.

I look at the cron file on the server:

* * * * * bitrix test -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php && { /usr/bin/php -d sendmail_path="msmtp -t -i -a xn--80ab1apcickh8i.xn--p1ai" -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php; } >/dev/null 2>&1


The file itself

<?php
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(FILE)."/../../../..");
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];

define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS",true);
define("BX_CRONTAB", true);
define('BX_WITH_ON_AFTER_EPILOG', true);
define('BX_NO_ACCELERATOR_RESET', true);

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");

@set_time_limit(0);
@ignore_user_abort(true);

CEvent::CheckEvents();

if(CModule::IncludeModule('sender'))
{
  \Bitrix\Sender\MailingManager::checkPeriod(false);
  \Bitrix\Sender\MailingManager::checkSend();
}

require($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/tools/backup.php");

CMain::FinalActions();
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2021-07-12
@Zikdelk

1) Cron operations most often perform a maintenance one-time function, and often something resource-intensive.
2) @set_time_limit(0); how the BE hints that "the meat is waking up now," which will take a lot of time.
3) require($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/tools/backup.php"); gives a hint that we will be doing something related to the backup, which is always not a quick operation.
So in general, the answer is - nothing, forget it, it should not often load the server, but what happens should happen anyway.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question