npx skills add ...
npx skills add bxmaximum/bitrix-framework-skills --skill bitrix-performance
Bitrix high-load tuning — Composite (dynamic areas, createFrame, StaticArea), query optimization, read replicas via the cluster module. Use when a page or query is slow or when enabling composite.
npx skills add bxmaximum/bitrix-framework-skills --skill bitrix-performance
Baseline: main 23.0+ · Verified: main 26.800.0
Caching itself: bitrix-caching. SQL profiling: bitrix-database (SqlTracker). Sessions: bitrix-sessions.
Static HTML of the page is served from the composite cache (NGINX can serve it directly); dynamic areas are fetched by a follow-up request. Enable in Settings → Composite site. Kernel: Bitrix\Main\Composite\Engine, Page, StaticArea, BufferArea.
In a component template ($this is CBitrixComponentTemplate):
Long stub markup: begin() → dynamic content → beginStub() → stub HTML → end().
Outside components (site template header, init.php helpers):
COMPOSITE_FRAME_MODE (A/Y/N) and COMPOSITE_FRAME_TYPE (AUTO, STATIC, DYNAMIC_WITH_STUB, DYNAMIC_WITHOUT_STUB).\Bitrix\Main\Composite\Page::getInstance()->markNonCacheable().data-dynamic attribute and no composite_frame_mode page property.filter/order.fetchCollection() + fill(), or relations in select (bitrix-orm).addMulti, updateMulti) instead of per-row loops.With the cluster module, SELECTs from query() may go to a slave. Pin read-after-write to the master:
Extra DBs (analytics, reports): a named connection in connections (bitrix-database).
use Bitrix\Main\Composite\StaticArea;
$area = new StaticArea('vendor_cart_counter');
$area->setStub('<span>0</span>');
$area->startDynamicArea();
echo (int)$basketCount;
$area->finishDynamicArea();$pool = \Bitrix\Main\Application::getInstance()->getConnectionPool();
$pool->useMasterOnly(true);
try
{
$row = OrderTable::getById($id)->fetch();
}
finally
{
$pool->useMasterOnly(false);
}