1C-Bitrix clustering: fault-tolerant cluster turnkey

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
1C-Bitrix clustering: fault-tolerant cluster turnkey
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1368
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    956
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    699
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    843
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    737
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1086

1C-Bitrix clustering: fault-tolerant cluster turnkey

Imagine: your Bitrix online store crashes on sale day — the server swaps, pages load in 30 seconds, managers lose orders. Even a powerful standalone server hits CPU and I/O limits under thousands of concurrent requests. For scaling an online store on Bitrix, we often see this picture at clients who reach 10,000 visitors per day. The only rescue is horizontal scaling: adding web nodes instead of upgrading a single server. Officially this feature is available starting from the "Small Business" edition. For Bitrix this is not just a "clustering" button — you need to solve three key problems: sessions, cache, and file storage. Our 10 years of experience in Bitrix development and over 100 scaling projects shows: without correct architecture you'll spend weeks debugging, and the result won't give performance gains.

Three bottlenecks to eliminate

Problem Essence Solution
Sessions PHP sessions stored on disk. Different nodes lose user session. Move sessions to Redis (or Memcached).
Files Uploaded files and cache unique to each node. Shared storage (NFS, GlusterFS or S3) for upload/ and cache directories.
Bitrix cache Managed cache in files — when cleared on one node, others serve stale data. Use Redis for cache (except HTML cache — it's better on NFS).

How to configure sessions in Redis for Bitrix?

Bitrix natively supports storing sessions in Redis. Configuration in /bitrix/.settings.php:

'session' => [
    'value' => [
        'mode'     => 'default',
        'handlers' => [
            'general' => [
                'type'    => 'redis',
                'host'    => '127.0.0.1',
                'port'    => 6379,
                'serializer' => \Redis::SERIALIZER_PHP,
            ],
        ],
    ],
],

For high availability we use Redis Sentinel — then if the master fails, sessions are not lost. Configuration is similar, just specify sentinels and master_name. Important: install the PHP redis extension. We prefer Redis over Memcached due to atomic operations and built-in persistence. In one project, sessions in Redis saved 20,000 shopping carts from loss during a balancer switch.

Moving Bitrix cache to Redis

Managed cache (/bitrix/cache/ and /bitrix/managed_cache/) is better stored in Redis. This speeds up reads and eliminates desync between nodes.

'cache' => [
    'value' => [
        'type'  => 'redis',
        'redis' => [
            'host' => '127.0.0.1',
            'port' => 6379,
            'serializer' => \Redis::SERIALIZER_IGBINARY,
        ],
    ],
],

The igbinary extension compresses data ~40% faster than PHP serialization. For HTML page cache (e.g., bitrix:page.polycore) Redis is inefficient due to object size — cache such pages at the nginx proxy_cache level or leave them on NFS.

Why is MySQL replication important?

With multiple web nodes, database load grows proportionally. A single master cannot handle SELECT queries. The solution is Master-Slave replication with query separation. Configuration in /bitrix/.settings.php:

'connections' => [
    'value' => [
        'default' => [
            'className' => '\\Bitrix\\Main\\DB\\MysqlConnection',
            'host' => 'mysql-master',
            'database' => 'bitrix',
            'login' => 'bitrix',
            'password' => 'secret',
        ],
        'slave' => [
            'className' => '\\Bitrix\\Main\\DB\\MysqlConnection',
            'host' => 'mysql-slave',
            'database' => 'bitrix',
            'login' => 'bitrix_ro',
            'password' => 'secret_ro',
        ],
    ],
],

For transparent request routing we use ProxySQL or a custom Connection Resolver. This reduces master load and increases throughput.

Choosing a file storage

Criteria NFS GlusterFS S3 (MinIO)
Ease of setup +++ + ++
Fault tolerance - ++ +++
Performance ++ ++ +
File locking + + -

NFS is a simple option for 2-3 nodes: quick to mount and low latency, but it's a single point of failure without replication. GlusterFS is harder to set up but replicates data between nodes and eliminates SPOF. S3-compatible storages (e.g., MinIO) are elastic and don't require physical servers, but latency is higher and the module Bitrix\Main\File\Remote\S3 is needed. For production we most often use GlusterFS — it has already saved more than one project from downtime. Example of NFS mounting:

mount -t nfs nfs-server:/srv/bitrix-shared /var/www/bitrix/upload

Load balancer configuration

Example nginx configuration with least_conn and health check

upstream bitrix_backend {
    least_conn;
    server web-node-1:80 weight=1 max_fails=3 fail_timeout=30s;
    server web-node-2:80 weight=1 max_fails=3 fail_timeout=30s;
    server web-node-3:80 weight=1 max_fails=3 fail_timeout=30s;
    keepalive 32;
}
server {
    listen 443 ssl;
    location / {
        proxy_pass http://bitrix_backend;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout 5s;
        proxy_read_timeout 60s;
    }
}

With proper session storage in Redis, sticky sessions are not needed — any node can handle any request. Exception: chunked file upload; for that you can enable sticky by IP or use a separate upload endpoint.

Process of work

  1. Audit — analyze current architecture, load, bottlenecks.
  2. Design — choose scheme: Redis, storage, balancer, replication.
  3. Configure Redis — sessions and cache, test fault tolerance.
  4. Configure file storage — NFS or GlusterFS, synchronize codebase (git/rsync/Ansible).
  5. Configure balancer — nginx upstream, health check, SSL termination.
  6. MySQL replication — Master-Slave + ProxySQL.
  7. Testing — load tests, check behavior when a node is disconnected.
  8. Documentation and training — hand over scheme and instructions.

What is included in the work

  • Architectural cluster diagram and configuration files.
  • Configured Redis (sessions + cache) with redundancy via Sentinel.
  • Shared file storage (NFS or GlusterFS) with automatic mounting.
  • nginx load balancer with health check and SSL termination.
  • MySQL replication with ProxySQL for query distribution.
  • Load testing and performance report.
  • Operations documentation and disaster recovery scheme.
  • Training of your team on basic operations.
  • Post-production support for one month.

Timelines and cost

Basic setup (2 nodes, Redis, NFS, balancing) takes 2–3 weeks. Production-grade scheme with GlusterFS, Redis Sentinel, monitoring, and automation takes 4–6 weeks. Cost is calculated individually after audit. Savings from avoiding expensive server upgrades can reach 60%. Reduction in server infrastructure costs up to 40% compared to a monolithic solution. Order an audit of your project — our engineers will assess scaling feasibility in 2 days. Get a consultation on choosing the optimal clustering scheme.

Cluster health check 1. Run load testing with Apache Bench or Siege. 2. Disconnect one web node — verify the site continues working. 3. Check file synchronization: create a file on one node, verify it is accessible on another. 4. Ensure sessions persist when switching between nodes.

1C-Bitrix Clustering

Imagine: a flash sale, 10,000 users simultaneously on the site, the server goes down with a 502 error, carts disappear, managers call support. We have seen this dozens of times. The solution is clustering: load balancing between servers, database replication, and automatic failover. Order an audit of your current infrastructure — in 2 days we will determine if and what kind of cluster is needed. Our experience: 40+ high-load projects on Bitrix.

Why is 1C-Bitrix clustering critical for fault tolerance?

80-90% of requests in a typical project are SELECT. Catalog, product pages, filters — all reads. Master-slave replication routes SELECTs to slave servers, leaving the master for writes only. The 'Web Cluster' module (Business edition and higher) routes requests automatically.

Common stumbling blocks: on master binlog_format = ROW. STATEMENT-based replication with NOW() or UUID() causes inconsistencies — leading to a week of debugging. Unique server-id, binary log enabled. On slave — read_only = ON, relay-log. Initialization via xtrabackup (not mysqldump, which locks tables for half an hour on a 20 GB database).

Metric #1 — Seconds_Behind_Master. If a slave lags by 5+ seconds, a customer places an order, returns to their personal account — and the order is missing (SELECT went to a lagging slave). The module allows manual exclusion of critical queries from slave routing.

Failover: Orchestrator or ProxySQL promote a slave to master in 15-30 seconds. The module supports up to 9 slave connections with configurable weights. Integrity check — pt-table-checksum from Percona Toolkit. Savings from inefficient infrastructure can be up to 40% of the budget, representing a significant annual amount for projects with 50,000+ unique visitors. For more information on replication, refer to MySQL Replication Documentation and Wikipedia: Database Replication.

When is clustering necessary?

Not every project needs it. Specific markers:

  • 50,000-100,000 unique visitors per day — a single server starts returning 502 errors during peak hours
  • Peak spikes of 5-10 times (sales, flash sales) — load grows in minutes, vertical scaling is not enough
  • SLA 99.9% (no more than 8.7 hours of downtime per year) — unattainable with a single server
  • Geographic distribution of users

Sometimes composite caching, SQL optimization, and vertical scaling are sufficient. We will honestly tell you if a cluster is not yet needed. Investments in clustering typically pay off within 3-6 months under peak loads. The average project budget is determined individually.

What does the cluster architecture consist of?

Load balancer. HAProxy, nginx upstream, or cloud LB. Round-robin for even distribution, ip-hash for session stickiness, least connections for adaptive balancing. Health checks remove dead servers from the pool. SSL termination on the balancer offloads web nodes.

Web servers. Identical nginx + php-fpm, each with a full copy of the code. Sessions in Redis/Memcached, not on disk (otherwise users lose their cart when switching servers). In the cloud — auto-scaling: load increases — servers are added, load decreases — they are removed.

Cache. Redis Cluster with data sharding across nodes. Redis Sentinel for small clusters. Memcached is fast but lacks persistence. Configuration in .settings.php — servers, weights, sharding strategy.

File storage. Uploads, images — accessible from each node. NFS for 2-3 servers, but it is a single point of failure. GlusterFS — distributed file system without single point of failure. S3 (MinIO, AWS, Yandex Object Storage) — offload static files to object storage, the Bitrix module works out of the box.

How to ensure failover at each cluster level?

Level Mechanism RTO
Load balancer Keepalived + VRRP < 5 sec
Web servers Health check < 10 sec
MySQL master Orchestrator / ProxySQL < 30 sec
MySQL slave Removal from pool < 5 sec
Redis Sentinel / Cluster failover < 15 sec
Files GlusterFS replication Automatic

The cluster is 5 times more reliable than a single server — if any node fails, the service continues to operate.

What are common clustering setup mistakes?

  • Sessions on files — when a server goes down, users lose cart and authentication.
  • Unmonitored Seconds_Behind_Master — sales suffer and SLA is unmet.
  • Single point of failure at the file storage level (NFS without replication).
  • Lack of replication monitoring — data inconsistencies go undetected.

We include checks for all these points in our audit and testing.

What is the clustering process?

  1. Load audit — load profile, bottlenecks, load testing. We find the ceiling of a single server.
  2. Design — components tailored to requirements and budget. Not everyone needs GlusterFS — sometimes NFS and backups suffice.
  3. Infrastructure — servers, network, firewalls. Ansible for automation — any node can be recreated in minutes.
  4. Migration — transfer with minimal downtime. Components are connected sequentially, each step verified.
  5. Testing — simulation of peak conditions. We crash the master, disconnect a web server, kill Redis — see how the system behaves.
  6. Documentation — architecture diagram, runbook, disaster recovery plans.

What does clustering work include?

Deliverable Description
Current load audit Request profile, bottlenecks, load testing
Project documentation Architecture diagram, runbook, disaster recovery plan
Infrastructure Server, network, firewall setup (Ansible)
Migration Transfer with minimal downtime, phased component connection
Testing Simulation of peak conditions: crash master, disconnect web server, kill Redis
Team training Documentation, 2 weeks of post-implementation consultations
Warranty 6 months of correct cluster operation — if something goes wrong, we fix it within 24 hours

What are the typical timelines?

Task Timeline
Audit and design 1-2 weeks
Basic cluster (2 web + master-slave MySQL) 2-3 weeks
Full cluster with failover at all levels 4-6 weeks
Monitoring + load testing 2-4 weeks

Contact us to get an engineer consultation and a preliminary project estimate within 2 days. We will calculate the cost based on your specific needs. Order an audit to find out the exact architecture and budget.