Setting up the performance panel for 1C-Bitrix
The performance panel is a built-in Bitrix profiling tool. Shows page generation time, SQL query count, cache time, memory usage. Available to administrators in the bottom right corner of the browser.
Enabling the panel
The performance panel is activated via Settings → Performance → Performance Panel or programmatically:
// Show panel for current user
$USER->SetShowStatPanel(true);
// Or in dbconn.php for debugging on dev environment
define('BX_STATPANEL', true);
The panel is visible only to authorized users in the "Administrators" group. On production, it's worth keeping enabled only during active debugging — it adds some overhead to data collection.
What the panel shows
Execution time — total PHP + SQL time in milliseconds. Breakdown: PHP time and MySQL wait time.
Database queries — SQL query count and total time. Click the block — opens list of all queries with execution time for each.
Cache — cache access count: hits (successes) and misses. Low hit rate (< 80%) — signal that cache is ineffectively configured or invalidated too often.
Files — number of included PHP files. 500+ files without OPcache — slow initialization.
Memory — peak memory consumption by PHP script. 64 MB+ — should check for leaks or excessive data loading.
Detailed SQL profiling
Click the SQL block in the panel — opens list of all queries. Sort by time. Queries > 50 ms — candidates for optimization via EXPLAIN.
Queries repeating 10+ times with the same pattern — N+1 problem. Usually properties of infoblock elements requested element-by-element.
Performance monitor settings
In Settings → Performance → Performance Monitor set:
- Log write threshold — 1000 ms for production, 500 ms for staging
-
Store records — 1000–5000 records in
b_perf_hittable - Record SQL — enable to see query list for slow pages
View log: Settings → Performance → View Log. Sort by total SQL time — most problematic pages will appear.
Using for specific problem diagnosis
Algorithm for working with the panel:
- Open slow page with panel enabled
- Look at PHP-time / SQL-time ratio. If SQL > 70% — optimize queries. If PHP time is large with small SQL — problem is in component code
- Open SQL query list, sort by time
- Copy slow query, run
EXPLAINin MySQL Workbench or phpMyAdmin - Add missing index, refresh page, verify improvement
The performance panel is the first tool for complaints about slow pages. Its data is enough for 80% of diagnostic tasks without additional tools.







