Performance Audit for a 1C-Bitrix Website
A catalog page takes 4 seconds to load. The reason is unclear — the server is powerful, the hosting provider isn't complaining. Without diagnostic tools, guesswork begins: "maybe the cache isn't working," "maybe the database is slow," "maybe the template is heavy." A performance audit gives a precise answer: exactly where time is being lost and how much can be gained by fixing each specific issue.
Diagnostic Tools
BX_DEBUG — Bitrix's built-in tool. In dbconn.php or bitrix/php_interface/init.php:
define('BX_DEBUG', true);
Displays at the bottom of the page: number of SQL queries, PHP execution time, memory usage, and cache hits. Benchmarks: < 50 queries, < 500 ms PHP time on a catalog page.
EXPLAIN ANALYZE for heavy queries. Slow queries are logged via slow_query_log in MySQL or log_min_duration_statement in PostgreSQL (threshold: 200 ms), then the execution plan is analyzed.
Xdebug + Profiler — for function-level PHP profiling. Generates a cachegrind file readable in QCacheGrind. Shows exactly which function is consuming time.
Typical Bottlenecks in Bitrix
N+1 in components. A product listing makes 1 query for the list and N queries for prices/properties. With 50 products on the page — 50 extra queries to b_iblock_element_property. Solution: use select with the required properties or batch fetching.
Disabled cache. A developer disabled the cache during development and forgot to re-enable it. Check in component settings (CACHE_TIME, CACHE_TYPE) and globally in Settings → Performance.
No indexes on custom tables. User-defined tables are created without indexes; queries with WHERE clauses then result in full table scans on millions of rows.
Heavy agents in the web process. CAgent::CheckAgents() is called on every hit if cron is not configured. Agents with heavy logic slow down every page request.
What Is Checked During the Audit
| Layer | What we measure | Tool |
|---|---|---|
| PHP | Execution time, memory peak | BX_DEBUG, Xdebug Profiler |
| SQL | Query count, slow queries | BX_DEBUG, slow_query_log |
| Cache | Hit rate, volume | Bitrix cache stats |
| HTTP | TTFB, page size, resources | Lighthouse, WebPageTest |
| Server | CPU, RAM, I/O wait | Zabbix, top, iostat |
Audit Report
The result is a table of bottlenecks with an assessment of impact and the effort required to fix each:
| Issue | Impact | Effort |
|---|---|---|
| N+1 in catalog component | -1.5 s per page | 4 hours |
| Agents in web process (no cron) | -0.3 s per hit | 30 min |
| Missing indexes on bl_custom | -0.8 s on filtered queries | 1 hour |
| No gzip on static assets | +300 ms JS/CSS load time | 30 min |
What Is Included in the Performance Audit
- Page profiling via BX_DEBUG and Xdebug
- Slow SQL query analysis and execution plan review (EXPLAIN)
- Cache configuration check at all levels (components, pages, CDN)
- Agent and cron job analysis
- HTTP-level audit: TTFB, compression, static asset caching
- Final report with a prioritized optimization plan







