APM Setup for 1С-Битрикс: Performance Monitoring

Imagine: during peak hours your Bitrix e-commerce site starts slowing down. Managers can't keep up with orders, the catalog opens in 8 seconds, and 1C exchange freezes. A single query to `b_iblock_element` takes 4 seconds — and there are thousands like it per minute. Standard Xdebug profiling shows

Our competencies:

Frequently Asked Questions

Imagine: during peak hours your Bitrix e-commerce site starts slowing down. Managers can't keep up with orders, the catalog opens in 8 seconds, and 1C exchange freezes. A single query to b_iblock_element takes 4 seconds — and there are thousands like it per minute. Standard Xdebug profiling shows the problem, but only when it's too late. APM works continuously, capturing every slow request, every error, and every throughput drop. We integrate APM into your 1С-Битрикс so you see real performance data 24/7. Unlike one-time measurements, APM provides time series: you know that yesterday p95 response time was 1.2s, and today it's 2.9s — and you can react immediately.

We use two main stacks: Elastic APM (open-source, self-hosted) and New Relic / Datadog (SaaS). For each project we pick the optimal option based on load and budget. The result — dashboards in Kibana or New Relic UI, alerts in Slack/Telegram, full control over performance. Below, technical details.

Process of Setting Up APM

  1. Architecture and load analysis. Identify critical points: slow pages, heavy SQL, external calls.
  2. Choose APM stack. Elastic APM or New Relic — based on speed, budget, and data control needs.
  3. Install and configure APM Server, Elasticsearch, and Kibana (or New Relic agent).
  4. Configure the PHP agent on the server. Optimize parameters like transaction_sample_rate.
  5. Create dashboards and alerts. Track p95 response time, error rate, Apdex.
  6. Test and calibrate. Validate data correctness and fine-tune notifications.

APM Monitoring in Bitrix

The PHP agent intercepts request execution and sends metrics to a central store. Elastic APM flow:

PHP-агент (elastic-apm-php) → APM Server → Elasticsearch → Kibana (APM UI) 

Installing the PHP agent:

# Debian/Ubuntu curl -L -O https://github.com/elastic/apm-agent-php/releases/download/v1.x.x/apm-agent-php_Linux_x86-64.deb dpkg -i apm-agent-php_Linux_x86-64.deb 

In php.ini:

extension=elastic_apm.so elastic_apm.server_url=http://apm-server:8200 elastic_apm.service_name=bitrix-site elastic_apm.environment=production elastic_apm.transaction_sample_rate=0.1 

transaction_sample_rate=0.1 — profiles 10% of requests. On high-load sites, 100% incurs noticeable overhead.

Overhead details

At sample_rate=0.1, overhead is less than 1% based on our measurements on projects with catalogs up to 500,000 products. For sites with fewer than 10,000 requests per minute, you can set 0.5 without significant impact.

The agent automatically captures:

  • Incoming HTTP requests — response time, status, URL, method.
  • SQL queries — to b_iblock_element, b_sale_order, b_crm_deal and all other tables. Shows time, query body, execution plan.
  • External HTTP calls — curl_exec, file_get_contents. Calls to 1C, payment gateways, external APIs.
  • Exceptions — \Bitrix\Main\SystemException, unhandled errors.

For custom operations (long import scripts, heavy aggregations), create spans manually:

use Elastic\Apm\ElasticApm; $transaction = ElasticApm::getCurrentTransaction(); $span = $transaction->beginCurrentContextSpan('import.products', 'custom'); // ... import logic ... $span->end(); 

Which APM to Choose: Elastic or New Relic?

Elastic APM is free, self-hosted, full data control. New Relic is cloud-based, easier to start, but pay-per-GB. For small projects (up to 500 requests/min), Elastic APM often suffices; for large ones with 1000+ requests/s, New Relic is more convenient with built-in alerts and integrations. We help you choose and set up either.

Parameter Elastic APM New Relic
License Open-source (Apache 2.0) Proprietary, paid
Hosting Self-hosted (requires server) SaaS (cloud)
Setup difficulty Medium (admin experience needed) Low (quick start)
Data control Full Limited by vendor policy
Built-in alerts Via Kibana Alerting Ready templates + integrations

Why transaction_sample_rate Matters?

This is the percentage of requests for which detailed traces are collected. 0.1 (10%) is the sweet spot: low overhead, enough data to find bottlenecks. Setting 1.0 profiles every request — overhead becomes noticeable at high loads. We tune sample_rate to your traffic and server resources. For a site with 100,000 visits/day, sample_rate 0.1 yields ~1,000 traces/minute — a statistically significant sample.

Key Metrics and Alerts

After setup, Kibana APM UI provides:

  • Response time — average and 95th percentile by URL.
  • Throughput — requests per minute.
  • Error rate — percentage of errored requests.
  • Apdex — satisfaction index: ratio of fast (<T), tolerable (<4T), and slow requests.

Alerts configured in Kibana Alerting: if p95 response time exceeds 3 seconds for more than 5 minutes — notification in Slack or email. For particularly critical pages (cart, checkout), we lower thresholds to 1 second.

Timelines

Stage Duration
Install APM Server + Elasticsearch 1 day
Configure PHP agent, first data 2–4 hours
Set up dashboards and alerts 1 day
Fine-tuning (sampling, custom spans) 1–2 days

What's Included?

We provide: full documentation of the APM architecture, maintenance instructions, training for your admin on Kibana/New Relic, notification setup in your corporate messenger. Optionally, integration with your existing monitoring system (Zabbix, Prometheus). Turnkey — from agent installation to live dashboards. Contact us for a consultation — we'll assess your project for free.

What the Data Says

According to Elastic APM PHP agent documentation, the minimum overhead at sample_rate 0.1 is less than 1% — confirmed by our measurements on projects with catalogs up to 500,000 products.

Why Choose Us?

We've been working with 1С-Битрикс and APM for over 5 years. We've set up monitoring for 40+ projects, including catalogs with millions of products and CRMs with thousands of deals per day. Experience with Elastic APM, New Relic, Datadog. We work under contract with a guarantee. Order APM setup for your Bitrix site and gain performance transparency.

APM doesn't replace profiling — it shows what is degrading and when. A profiler explains why. But together they give full control. Get a consultation — we'll help you find the optimal solution.