Scaling 1C-Bitrix: From Audit to High-Performance Cluster

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.

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

Preparing for Horizontal Scaling

"We need scaling" — a request that usually means one of three things: the site slows down under peak loads, a multiple increase in traffic is planned, or high availability is required. These are different tasks with different solutions. Horizontal scaling of Bitrix is not just adding another server; it's a re-architecture with separation of component responsibilities. Over 10+ years, we have implemented more than 30 scaling projects — from small online stores to corporate portals with millions of visits. We specialize in 1C-Bitrix scalability and Bitrix24 setup for enterprise clients.

Without proper preparation, horizontal scaling brings more problems than benefits: sessions drift apart, cache is not synchronized, 1C import files block the database. Let's break down how to avoid this.

Database is often not the first bottleneck

Clients often believe the bottleneck is the database. In 60% of cases, the real problem is PHP code or caching. We profile: if MySQL CPU usage is below 30% while PHP-FPM hits 90%, we need to grow web nodes, not the database. Only after fixing "soft" issues do we move to infrastructure.

Code changes for stateless architecture

The main issues to fix before adding nodes:

  • Bitrix file cache: migrate to Memcached or Redis.
  • Local temporary files: find via grep -r "file_put_contents\|fopen\|tempnam" /var/www/bitrix/local/.
  • Sessions: store in Memcached/Redis.
Why local file writes break horizontal scaling

Every local file write from custom modules is a potential problem in a cluster because it creates inconsistent state across nodes. We help rewrite custom code to use shared storage or external services.

Scaling Strategies

Decomposition: What scales separately

Component Scaling Method Complexity
PHP application Horizontal (multiple nodes) Medium
MySQL Vertical + read replicas Medium
Elasticsearch Horizontal (shards/nodes) High
Memcached/Redis Horizontal (pool) Low
File storage NFS / S3-compatible Medium
Static content (CDN) CDN offload Low

Start with the component that is the actual bottleneck — not the one that "seems right". For example, if a CDN can offload 60% of traffic, that's the quickest win.

Vertical vs. Horizontal: What to choose?

Vertical (more CPU/RAM) — fast, no code changes required, but has a ceiling and cost. Up to 32 GB RAM on the DB server, vertical scaling is often more cost-effective than horizontal. However, at equal peak load, vertical can be 30% more expensive due to premium cloud provider pricing. For instance, a 16 vCPU vertical solution may cost $500/month, while 3 horizontal nodes might run $600/month but provide redundancy. Horizontal scaling can be up to 3x more cost-effective than vertical when running 5+ web nodes.

Horizontal — more complex (requires stateless architecture, shared storage, cache coordination), but has no upper limit and provides fault tolerance. Experience shows horizontal scaling pays off starting at 3+ web nodes. Since implementing horizontal scaling, a client's monthly hosting costs decreased by 25% while handling 3x more traffic.

Cost comparison at a glance
Criteria Vertical Horizontal
Implementation complexity Low High
Growth limit Limited (max 64 vCPU) Unlimited
Fault tolerance No (single point) Yes
Code changes required No Yes (stateless)
Typical cost at peak load ~30% more Cheaper with 3+ nodes
Example monthly cost (16 vCPU equivalent) $500 $600 (3 nodes)

Specific Scaling Scenarios

Scaling via CDN

The fastest way to offload the application is to serve static files and images via a CDN. For Bitrix, configure through the cdn module or via nginx:

# Static files with long TTL — cached by CDN
location ~* ^/upload/.*\.(jpg|webp|png|css|js)$ {
    add_header Cache-Control "public, max-age=2592000";
    add_header Vary Accept-Encoding;
    # CDN picks up from Cache-Control
}

Set the CDN provider's origin to your server. The CDN caches static files on its edge nodes worldwide. Result: requests for images and CSS/JS never reach your server — the CDN serves them from the node closest to the user.

Learn more about CDN principles on Wikipedia.

Scaling 1C Import

Importing large catalogs (100,000+ SKUs) is resource-intensive and should not run on production nodes. Set up a dedicated worker node:

[1C] ---> [Import Worker Node] ---> [DB Master] ---> [Web Nodes] (read-only during import)

On the worker: PHP memory_limit = 1G, max_execution_time = 600, a separate PHP-FPM pool with 2–3 workers. Web nodes switch to read from a replica during import.

Auto-Scaling in the Cloud

For projects on Yandex Cloud, VK Cloud, or AWS, auto-scaling of web nodes is possible:

Instance Group / Auto Scaling Group:

  • min_instances: 2
  • max_instances: 10
  • scale_up: CPU > 70% for 3 minutes
  • scale_down: CPU < 30% for 10 minutes
  • cooldown: 300s

Load balancing via Application Load Balancer. Requirements: a pre-built Bitrix server image, configuration pulled from storage on instance start, the load balancer automatically registers new nodes.

Auto-scaling prerequisites
  • Pre-built Bitrix server image with all dependencies
  • Configuration managed externally (e.g., in S3 or Config Server)
  • Stateless application code
  • Shared session/cache storage (Memcached/Redis)
  • Monitoring for scale triggers

Our Scaling Process

What stages does 1C-Bitrix scaling setup include?

  1. Performance audit — profiling PHP, MySQL, cache, identifying bottlenecks.
  2. Defining scaling strategy: vertical, horizontal, or hybrid.
  3. Configuring Memcached/Redis cache and sessions.
  4. Deploying cluster infrastructure — nginx, PHP-FPM, load balancer.
  5. Connecting CDN for static content and images.
  6. Setting up monitoring (Zabbix/Prometheus) and auto-scaling.

After scaling, our client's site handles 10,000 requests per minute without downtime.

What's Included in the Scaling Work

Each project includes:

  • Audit of current architecture and bottleneck profiling
  • Design of a scaling scheme (vertical/horizontal/hybrid)
  • Cache setup (Memcached/Redis) and sessions
  • Web server configuration (nginx, PHP-FPM)
  • Load balancer and node group deployment
  • CDN integration
  • Monitoring setup (Zabbix/Prometheus)
  • Load balancing and high availability
  • Documentation and training for your engineers
  • 30-day warranty support after delivery

A typical scaling project for a mid-size online store costs between $3,000 and $8,000, depending on complexity.

How long does it take?

Realistic timelines for planning:

  • CDN offload of static content: 1–2 days, offloads 40–60% of server load
  • Move cache to Memcached + 2 web nodes: 3–5 days, horizontal PHP scaling
  • Full cluster (3 web + DB master/replica + shared storage): 8–15 days
  • Cloud auto-scaling: 10–20 days (including DevOps infrastructure)

For 1C-Bitrix scalability, horizontal scaling with load balancing and CDN offload ensures optimal performance under high traffic. Order a scaling audit — our engineers are certified for 1C-Bitrix, use proven patterns, and provide written guarantees on all work.

Common Questions

When is scaling needed for 1C-Bitrix?

Scaling is required when the site slows down under peak loads, traffic is expected to grow several times, or high availability is needed. We start with a performance audit to identify the bottleneck.

How long does cluster setup take?

Timelines depend on complexity: CDN offload — 1-2 days, moving cache to Memcached plus two web nodes — 3-5 days, a full cluster with replicas — 8-15 days.

What are the code requirements for horizontal scaling?

The code must be stateless: no local file cache or temporary files. All sessions and cache must be stored in Memcached or Redis. We help adapt custom modules.

What is included in a scaling project?

Includes performance audit, architectural blueprint, cache setup, nginx and web server configuration, cluster infrastructure deployment, CDN integration, monitoring setup, documentation, and team training. After delivery, a 30-day warranty support.

How is the budget for scaling calculated?

Cost depends on the scope. We conduct an audit and provide an accurate estimate. Contact us for a free consultation.

Get a consultation for your project — we will help you choose the optimal solution.

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.