When Does Standard 1C-Bitrix Search Start to Slow Down?
The built-in search in 1C-Bitrix uses tables b_search_content, b_search_content_stem, and b_search_stem. For a catalog of 30,000 items, full re-indexing takes 4–12 hours, the agent CSearchIndex::IndexAgent runs continuously, and search quality remains low: stemming fails with Russian morphology, relevance does not account for sales. Our experience shows that proper tuning reduces indexing time by 50–80% and improves result accuracy by 30–40%. We have been working with Bitrix for over 10 years and guarantee results. The problem worsens when multiple modules are active on the site—each extra module adds 15–20% to the index table size. A typical scenario: an admin enables search for forums, blogs, and documents, although users only need the product catalog. The index bloats, queries slow down, and the agent cannot keep up with changes.
Diagnosing Current Indexing
First, we check the state of index tables:
SELECT
table_name,
ROUND(data_length / 1024 / 1024, 2) AS data_mb,
ROUND(index_length / 1024 / 1024, 2) AS index_mb,
table_rows
FROM information_schema.TABLES
WHERE table_schema = DATABASE()
AND table_name LIKE 'b_search%'
ORDER BY data_length DESC;
The b_search_content_stem table on a large portal can occupy 2–5 GB. OPTIMIZE TABLE for it blocks queries for hours—we only do it during a maintenance window.
How to Configure Indexing Parameters?
In the administrative interface (Settings → Search → Settings), we change key parameters:
-
Minimum word length — increase from 2 to 3–4. Two-letter words clutter the index and carry no search value.
-
Stop words — add prepositions, conjunctions, articles. For a Russian-language site, the basic list includes 50–80 words.
-
Indexed modules — disable modules whose search is not needed by users (forums, blogs, document workflow).
-
Number of elements per agent run — optimally 50–100.
// In search module settings or via agent
CSearch::ReIndex($moduleId, $start, $finish, $step = 50);
Incremental vs. Full Indexing
Full re-indexing (ReIndexAll) is only for initial setup or after major catalog structure changes. In normal operation, incremental indexing via agent should work. Problem: the agent CSearchIndex::IndexAgent triggers on any change of DATE_CHANGE. During synchronization with 1C, the date changes even if content hasn't—the agent effectively re-indexes the entire catalog every time. Solution: compare hash of significant fields before and after update. Update DATE_CHANGE only on actual change:
$oldHash = md5($oldElement['NAME'] . $oldElement['DETAIL_TEXT'] . implode(',', $oldProperties));
$newHash = md5($newElement['NAME'] . $newElement['DETAIL_TEXT'] . implode(',', $newProperties));
if ($oldHash !== $newHash) {
// Update with DATE_CHANGE change
} else {
// Update stock/prices without triggering re-indexing
$DB->Query("UPDATE b_iblock_element SET TIMESTAMP_X = TIMESTAMP_X WHERE ID = {$id}");
}
MySQL FULLTEXT vs. Elasticsearch: Which to Choose?
| Parameter |
MySQL FULLTEXT (built-in) |
Elasticsearch (via module) |
| Speed on 30,000 items |
0.5–2 sec |
0.1–0.3 sec |
| Russian morphology |
Basic (stemming) |
Full (morphology) |
| Faceted search |
Not supported |
Supported |
| Setup complexity |
Low |
Medium |
| Server resource usage |
Low |
Requires separate server |
If your catalog has up to 30,000 items and you need simple search, optimizing FULLTEXT is enough. For 50,000+ and complex filters, better use Elasticsearch.
Cleaning Stale Index Records
On live sites, b_search_content accumulates records of deleted items. We clean in batches of 1000 via agent or cron—never run a single DELETE on 100,000 in production:
-- Find records of deleted iblock elements
SELECT sc.ID, sc.PARAM1, sc.PARAM2
FROM b_search_content sc
LEFT JOIN b_iblock_element ie ON ie.ID = CAST(sc.PARAM1 AS UNSIGNED)
WHERE sc.MODULE_ID = 'iblock'
AND ie.ID IS NULL
LIMIT 10000;
What's Included in Search Optimization?
- Diagnostics of current indexes and search module settings
- Configuration of stop words, minimum word length, exclusion of unnecessary modules
- Optimization of incremental indexing agent (field hashing)
- MySQL FULLTEXT tuning (my.cnf: innodb_ft_min_token_size, stopword table)
- Cleaning garbage from indexes
- Monitoring of zero-result queries (b_search_log)
- Documentation with recommendations and support procedures
Monitoring Search Quality
After optimization, we enable logging of queries that return zero results. Zero-result queries signal need for content expansion or migration to Elasticsearch.
Case Study: 4x Reduction in Indexing Time
Client — an online auto parts store (40,000 items). Full indexing took 8 hours, the agent kept CPU load at 70–90%. After configuring incremental indexing with hashing and optimizing FULLTEXT, full traversal time dropped to 2 hours, CPU load to 15–20%. Search quality improved: zero-result queries decreased by 35%. Budget savings on cloud resources amounted to about 400,000 RUB per year.
Typical Mistakes in Search Configuration
- Setting minimum word length to 1: index fills with garbage, search slows down.
- Full re-indexing every night: unnecessary load; incremental is sufficient.
- Ignoring stop words: search finds articles with prepositions instead of needed products.
- No monitoring: zero-result queries remain unnoticed, content not enriched.
Result
Optimizing parameters and indexing strategy reduces full traversal time by 50–80%, lowers agent load to background levels, and improves relevance. Contact us to get a consultation and work plan. Order a search audit — we will evaluate your project in one day.
80% of Bitrix sites slow down due to one table
b_iblock_element_property is an EAV structure where each row stores one value of one property of one element. A catalog of 50,000 products with 30 properties yields 1.5 million rows. The smart filter performs a JOIN of this table with b_iblock_element on five properties, and MySQL performs a full table scan for 3–5 seconds. Our experience shows that without intervention in this table, site acceleration is impossible. We take on projects where load time has dropped to 8–10 seconds and bring TTFB back to <200 ms within 1–2 weeks. Site speed optimization begins with an audit of slow queries and ends with a comprehensive turnkey infrastructure overhaul.
Contact us for an audit — we will identify bottlenecks within 2 hours and propose a concrete plan.
How to achieve TTFB below 200 ms?
Server optimization is the first step. Nginx configuration goes beyond simple gzip. Specifically:
-
gzip_comp_level 4-5 — higher is pointless, CPU consumes more than it saves bandwidth.
-
brotli on with brotli_static on for precompressed files.
- HTTP/2 with
http2_max_concurrent_streams 128.
-
fastcgi_cache for PHP responses — caching at Nginx level, bypassing PHP-FPM entirely.
-
worker_processes auto, worker_connections according to the number of simultaneous connections.
PHP-FPM tuning: choose between pm = dynamic and pm = static. Static mode works best for dedicated servers with predictable load because it avoids forking overhead. Dynamic saves RAM under low traffic. Calculate pm.max_children as (available RAM - RAM for MySQL/Redis) / average process consumption. For OPcache set memory_consumption=256, max_accelerated_files=20000, and validate_timestamps=0 in production (restart PHP-FPM on deploy).
MySQL/MariaDB: the main bottleneck is almost always the database. Enable slow_query_log with a threshold of 0.5 sec and analyze every query via EXPLAIN. Set innodb_buffer_pool_size to 70–80% of available RAM on a dedicated server. Create composite indexes for faceted search: (IBLOCK_ID, IBLOCK_PROPERTY_ID, VALUE) on b_iblock_element_property. Run OPTIMIZE TABLE b_iblock_element_property after mass operations.
How to configure three-level caching?
Managed component cache. Set TTL individually for each component. Catalog — 3600 sec, news feed — 300 sec, banners — 86400. The same TTL everywhere guarantees either outdated data or useless cache.
Composite cache. The bitrix:composite technology lets Nginx serve ready HTML from a file; PHP is not executed. Dynamic zones (cart, authorization) are loaded via AJAX request through CBitrixComponent::setFrameMode(true). TTFB drops below 50 ms. However, not all components are compatible; $APPLICATION->ShowPanel() and direct output via echo break the composite. We check every page through the panel 'Performance → Composite Site'. According to Bitrix official documentation on composite cache, this is the most effective caching method for high‑load projects.
Comparison: composite cache is 10–20 times faster than managed cache in time to first byte.
Memcached / Redis. Transfer cache from the file system: sessions go to Redis (session.save_handler = redis) — 10–50 times faster than files, plus cluster support. Component cache goes to Memcached via .settings.php: 'cache' => ['type' => 'memcache']. Also enable ORM query cache so identical GetList() calls don't hit MySQL on every request.
What is the fastest way to optimize Bitrix database?
Default MySQL settings are insufficient. Indexes — composite for faceted search, covering for frequent queries. MySQL responds from the index without accessing the data. Partial indexes (MariaDB) for filtering by ACTIVE = 'Y'. Audit unused indexes — each slows down INSERT/UPDATE.
Partitioning. For tables with millions of rows: b_stat_session, b_search_content_stem, and highload-blocks with history. Partition by date — a query for 'orders in a month' does not scan three years of data. Partitioning also solves the problem of concurrent queries during exchange with 1С via CommerceML.
Real case: a catalog of 200,000 products, 50 properties. Filtering by 10 properties took 12 seconds. After creating composite indexes on (IBLOCK_ID, IBLOCK_PROPERTY_ID, VALUE) and partitioning b_iblock_element_property by IBLOCK_ID, execution time dropped to 0.3 seconds. MySQL load decreased by 40 times.
Cleanup. Over a year or two, any database accumulates: outdated search index, expired records in b_cache_tag, history in b_iblock_element_prop_s*, logs in b_event_log taking gigabytes. We set up regular cleanup via agents.
Frontend and CDN
Images account for 60–80% of page weight. Convert to WebP via CFile::ResizeImageGet() with BX_RESIZE_IMAGE_PROPORTIONAL + conversion. Use srcset + sizes — never load a 3000px image into a 400px block. Add loading="lazy" for everything below the fold. AVIF offers another 20–30% savings vs WebP.
CSS/JS optimization: use the built-in Bitrix module to merge and minify via 'Settings → CSS/JS Optimization'. Apply PurgeCSS / UnCSS — in a typical Bitrix project, 60–70% of CSS is unused. Use defer / async for non‑critical JS and inline critical CSS in <head> for instant FCP.
Fonts: add <link rel="preload" as="font" crossorigin> for the main font. Set font-display: swap — text visible immediately. Subset via pyftsubset — keep only Cyrillic + Latin, file size reduces by 3–5 times.
CDN: Cloudflare, BunnyCDN, AWS CloudFront, or Russian providers (Selectel CDN, VK Cloud CDN). Serve static assets (CSS, JS, images, fonts) via CDN with Cache-Control: public, max-age=31536000, immutable for files with a hash. Use on‑the‑fly image optimization (imgproxy, Cloudflare Polish) without load on origin.
Why is load testing necessary?
Not synthetic benchmarks, but real scenarios: k6 / wrk to simulate routes — catalog → filtering → product card → cart → checkout. Measure RPS, response time (p50, p95, p99), error rate. Use Xdebug (callgrind) or Blackfire for PHP profiling to find bottlenecks. The test result gives an objective picture of where it actually slows down, not where it 'seems'. After optimization, run again to record improvements.
Results
| Metric |
Before |
After |
| TTFB |
800–2000 ms |
50–200 ms |
| Full load |
4–8 sec |
1.5–2.5 sec |
| PageSpeed (mobile) |
30–50 |
80–95 |
| Concurrent users |
50–100 |
500–2000+ |
What is included in the work?
-
Current performance audit — analysis of slow queries, PHP profiling, check of caching, CDN, server settings.
-
Server configuration — Nginx, PHP-FPM, MySQL, Redis/Memcached, OPcache.
-
Caching optimization — managed cache, composite site, TTL configuration, tagged caching.
-
Database work — index creation, partitioning, cleanup, EAV table reorganization.
-
Frontend — images (WebP/AVIF), CSS/JS (minification, deferred), fonts (preload, subsetting).
-
CDN — connection, caching rule setup.
-
Load testing — real user scenarios, metric report.
-
Documentation — description of all changes, recommendations for further maintenance.
-
Guarantee — support for 1 month after delivery, ensuring all optimizations are stable.
Monitoring
Without monitoring, everything degrades in six months. A new module, uncleared logs, a template change — and speed returns to original. Use web-vitals API for Real User Monitoring from actual visitors. Set up synthetic monitoring with Pingdom or UptimeRobot for regular checks from different locations. Configure alerts — TTFB > 500 ms or LCP > 3 sec triggers notification.
Timelines and cost
| Type of work |
Timeline |
| Basic optimization (cache, images, minification) |
2–3 days |
| Database optimization (indexes, slow queries, configuration) |
3–5 days |
| Server infrastructure (Nginx, PHP-FPM, Redis) |
2–3 days |
| Comprehensive (server + database + frontend + CDN) |
1–3 weeks |
| Load testing and profiling |
2–3 days |
| Cluster architecture (balancing, replication) |
1–2 weeks |
Cost is calculated individually after the audit. Get a consultation for your project — we will evaluate the current state and propose an acceleration plan with specific timelines and budget. We are a team with 12+ years of experience in Bitrix, having completed over 300 site speed optimization projects. Contact us to start the performance audit today.