Speed Optimization for 1С-Битрикс Exchange

This article is your guide to 1C Bitrix exchange optimization, CommerceML tuning, and catalog import acceleration techniques. Exchange involving 50,000 products takes 4 hours and blocks the entire site during business hours. This is a typical symptom when the catalog has grown 10x but the settings r

Our competencies:

Frequently Asked Questions

This article is your guide to 1C Bitrix exchange optimization, CommerceML tuning, and catalog import acceleration techniques. Exchange involving 50,000 products takes 4 hours and blocks the entire site during business hours. This is a typical symptom when the catalog has grown 10x but the settings remain unchanged. Every hour of downtime costs thousands of dollars. We encounter such projects daily: clients complain about slowdowns, and the root cause is an outdated exchange mechanism. Speed optimization involves a comprehensive audit and redesign on both the 1С and 1С-Битрикс sides. Our experience includes 10+ years with Bitrix and over 50 integration projects. Our specialists are certified 1С-Битрикс developers with 10+ years of experience. This article covers key methods: batch loading, deferred indexing, and caching. You'll learn how to cut exchange time from several hours to 20–30 minutes. For a tailored solution, contact us for a consultation—we'll prepare a proposal within one day.

How to profile the 1С exchange?

Before optimizing, measure. Add timestamps to the exchange log:

Profiling code example
// In the OnIBlockElementImport handler $timings[] = [ 'step' => 'element_import', 'element' => $elementXmlId, 'time' => microtime(true) - $startTime, ]; 

After the exchange, analyze where 80% of the time is spent. Typical candidates:

  • XML parsing—files too large, not split into parts
  • Database writes—indexes, triggers, non-optimal INSERT
  • Price recalculation—if auto-recalculation by rules is enabled
  • Search update—reindexing search index on every change

XML Parsing as a Bottleneck

Split the export into batches. In 1С settings, set "Number of elements per file" to 1000–2000. Each file is processed by a separate HTTP request. Bitrix processes the file in 30–60 seconds instead of hanging for 2+ hours. Batch processing is 10x faster than point-by-point.

Enable ZIP compression. A file with 2000 products uncompressed is 8–15 MB; compressed it's 1–3 MB. This is significant for the channel between 1С and hosting, especially with slow connections. In the publication settings of 1С ( CommerceML protocol): set Use data compression: Yes, Compression threshold: 1024 bytes. CommerceML is a standard for exchanging catalog data between 1С and web systems.

How to optimize database writes during import?

Standard Bitrix import calls CIBlockElement::Add/Update for each element—a full cycle with checks, event handlers, and cache invalidation. For 50,000 elements, that's 50,000 individual transactions.

Disable unnecessary events during import:

// Before import define('BX_BUFFER_MESS', true); // do not send email notifications $GLOBALS['STOP_STATISTICS'] = true; // do not update statistics define('NO_AGENT_STATISTIC', true); 

Deferred reindexing. Search reindexes after every element change. For batch import, disable auto-indexing and run reindexing as a separate agent after the exchange completes:

// Temporarily disable indexing \Bitrix\Main\Config\Option::set('search', 'indexer_auto_mode', 'N'); // After exchange, run reindexing CSearch::ReIndexAll(true, CATALOG_IBLOCK_ID); 

Batch cache invalidation. Instead of BXClearCache on every element update, collect changed elements into an array and invalidate cache in a batch at the end of the exchange.

Optimizing Database Queries During Import

When updating an element, Bitrix performs a SELECT to check existence, then UPDATE or INSERT. For batch import, preload all XML_IDs into memory and avoid SELECT per element:

// One query to get all existing elements $existing = []; $res = CIBlockElement::GetList( [], ['IBLOCK_ID' => CATALOG_IBLOCK_ID], false, false, ['ID', 'XML_ID'] ); while ($el = $res->Fetch()) { $existing[$el['XML_ID']] = $el['ID']; } // Now during import: isset($existing[$xmlId]) instead of SELECT 

Separating Exchange by Data Type

Full exchange (catalog + prices + stock) in one session is excessive. Split into independent streams:

Stream Contents Frequency Load
Full catalog Descriptions, properties, images Once/night High, at night
Prices Only offers*.xml with prices Every hour Low
Stock Only offers*.xml with stock Every 15 min Minimal
Orders orders.xml Every 15–30 min Minimal

In 1С, you can configure multiple independent scheduled jobs for different export types.

Caching on the Bitrix Side

Check the catalog module cache settings: Settings → Product Settings → Performance:

  • Catalog element cache: enable, TTL 3600 seconds
  • Property cache: enable
  • Trade offer cache: enable for stores with variations

During exchange, cache is automatically invalidated for changed elements. If invalidation takes long, check the cache disk size (/bitrix/cache/iblock/), increase memory_limit if needed.

Case Study: Cutting Exchange Time from 4 Hours to 25 Minutes

One of our clients, an auto parts e‑store with 65,000 SKUs, ran exchange once a day and it took 4+ hours, blocking price recalculation for the entire period. From our practice.

Issues found:

  1. Entire catalog in one XML file (240 MB)
  2. Reindexing search on every element
  3. Price recalculation by 12 rules on each price change
  4. BXClearCache for the whole infoblock every 100 elements

After optimization:

  • Splitting into files of 2000 elements
  • Deferred reindexing in a separate agent
  • Price recalculation only after import completion, not during
  • Batch cache invalidation at session end

Result: full exchange in 25 minutes. Stock and price updates only (every hour) in 3–4 minutes. Cost savings of approximately $400 per month due to reduced site downtime.

What's Included in the Optimization Service?

When ordering a turn‑key service, we:

  • Profile and audit the current exchange
  • Split export into batches, configure ZIP
  • Disable unnecessary events, set up deferred indexing
  • Implement batch cache invalidation and XML_ID preloading
  • Separate exchange by data type (catalog, prices, stock)
  • Document all settings and hand over instructions

Basic optimization starts at $500; a full audit with custom import is from $1,500. Optimization timelines:

Stage Time
Profiling and analysis 4–8 hours
Batch splitting + ZIP 2–4 hours
Deferred indexing + cache 1 day
Stream separation 1–2 days
Full audit and custom import 3–5 days

We'll estimate your volume and provide exact timelines. Order an exchange audit—we'll identify bottlenecks and propose an optimization plan.