A single data center in Moscow gives 80–120 ms latency for users from Novosibirsk and 150–200 ms from Almaty. Under highload across multiple regions, this accumulates: a page with 30+ API requests opens in 3–4 seconds instead of 1. A multi-region setup (also called geo-distributed cluster) solves this by routing users to the nearest node—cutting load time by 2–3x compared to a single-server deployment. For Bitrix, this is nontrivial because it requires working with distributed state. Our experience shows that a properly designed multi-region 1C-Bitrix cluster with database replication and Redis solves state distribution challenges. Savings on hosting with this distributed architecture reach 40% compared to renting capacity in each region separately, potentially saving between $500 and $2,000 per month depending on traffic, with typical savings of $1,200 per month. We have 5+ years of experience and 50+ successful Bitrix clustering projects. For a multi-region cluster with Bitrix, database replication, Redis cluster, GeoDNS, and CDN are essential.
We offer a consultation on your cluster architecture and will evaluate your project within two days after an audit. The project cost for a geo-cluster setup is $12,000 to $18,000 depending on complexity.
How does a multi-region cluster reduce latency?
To deploy a geo-distributed Bitrix cluster, follow these steps:
- Design architecture.
- Set up database replication.
- Configure Redis.
- Synchronize files.
- Set up GeoDNS.
- Test failover.
What is the best architecture for two regions?
Typical scheme for two regions (Moscow + another):
[GeoDNS / Anycast BGP]
/ \
[Region-MSK] [Region-EKB]
Web-1, Web-2 Web-3, Web-4
Redis-1 (master) Redis-2 (replica)
[DB Master] <--> [DB Replica]
[File Storage] rsync [File Storage Mirror]
Key decisions:
- DB Master is placed in only one region. Writes go to master, reads can be distributed to replicas.
- File synchronization—via S3-compatible storage (recommended) or one-way rsync from master, uploads to regional nodes are prohibited.
- Sessions—via Redis with replication between regions, sessions are written to the master region.
- If the link breaks, work only from the master region to avoid data divergence.
Limitations of GeoDNS
The simplest level is DNS by geolocation. Use Cloudflare, AWS Route 53, or Yandex Cloud DNS. For example, with Cloudflare, you can create geo-routing records: EU points to 185.10.1.100, RU-east to 195.20.2.100.
GeoDNS limitation: TTL affects failover speed. For fast failover, use Anycast BGP (one IP, different servers in different locations, network-level routing).
Configuring the Cluster Module in Bitrix
Bitrix ships the cluster module (Bitrix Web Cluster) that manages distributed nodes. Key settings are in /bitrix/.settings.php. Below is an example configuration for connections to master and replica:
'connections' => [
'value' => [
'default' => [
'className' => '\Bitrix\Main\DB\MysqlCommonConnection',
'host' => '10.0.1.10', // master (MSK)
'port' => 3306,
'database' => 'bitrix_db',
'login' => 'bitrix',
'password' => '***',
'options' => 2,
],
'slave' => [
'className' => '\Bitrix\Main\DB\MysqlCommonConnection',
'host' => '10.0.2.10', // replica (EKB)
'port' => 3306,
'database' => 'bitrix_db',
'login' => 'bitrix_ro',
'password' => '***',
'options' => 2,
],
],
],
Read requests are forwarded to replica using \Bitrix\Main\Application::getConnection('slave'). Standard APIs (D7 ORM, CIBlockElement::GetList) use the default connection. For automatic read/write splitting, you need an intermediary layer—ProxySQL or a custom wrapper.
Database Replication Setup Between Regions
For DB synchronization, we use MySQL GTID replication over an encrypted channel (stunnel or WireGuard). Master and replica configuration:
# On master (MSK)
[mysqld]
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
gtid_mode = ON
enforce_gtid_consistency = ON
binlog_format = ROW
# On replica (EKB)
[mysqld]
server-id = 2
gtid_mode = ON
enforce_gtid_consistency = ON
read_only = ON
relay_log = /var/log/mysql/relay-bin.log
After replication is configured, run CHANGE MASTER TO with master parameters, then start the replica. Replication lag between regions is typically 50–200 ms on a 100 Mbps link with 20–30 ms latency. Critical: after an order is created, the user may not see it on the replica if lag >200 ms. Solution: after a write, direct the specific session to the master for 5–10 seconds.
File Synchronization: S3 vs rsync
Files in upload/ must be available on all nodes. We recommend S3-compatible storage (Yandex Object Storage, AWS S3, MinIO). Bitrix can work with S3 via the bitrix.cloud module or a custom handler. A CDN in front of S3 delivers files from the nearest region. If S3 is not feasible, use one-way rsync from master to replica: */1 * * * * rsync -az --delete /var/www/bitrix/upload/ ekb-storage:/var/www/bitrix/upload/. Uploading files on regional nodes is prohibited—all uploads proxy to the master region.
When integrating with 1C via CommerceML, file exchange must occur through the master region.
Redis: Distributed Sessions and Cache
User sessions must be available on any node. We use Redis with replication (Sentinel or Cluster). Redis with replication gives session read latency up to 1 ms, which is 50x faster than file-based sessions (50 ms). Configuration in /bitrix/.settings.php:
'session' => [
'value' => [
'mode' => 'separated',
'handlers' => [
'general' => [
'type' => 'redis',
'host' => '10.0.1.20', // Redis MSK (master)
'port' => 6379,
],
],
],
],
'cache' => [
'value' => [
'type' => 'redis',
'redis' => [
'host' => '10.0.1.20',
'port' => 6379,
],
'sid' => 'bitrix_geo',
],
],
Cache can be stored locally in each region; sessions must be in the master region or in a Redis Cluster with cross-region replication.
Regionalizable Operations
| Operation | Can run on regional node | Notes |
|---|---|---|
| Catalog reads | Yes | From DB replica |
| Product page, category | Yes | From cache or replica |
| Search | Yes | Elasticsearch with replication |
| Add to cart | No | Master only |
| Checkout | No | Master + master DB |
| File upload | No | Only S3 or master node |
| Authorization | No | Sessions via master Redis |
For a Bitrix store, catalog pages are served from the nearest region, checkout is always proxied to the master region. Split-routing is implemented at the nginx level:
location /bitrix/components/bitrix/sale. {
proxy_pass http://msk_master; # orders always to MSK
}
location / {
proxy_pass http://geo_cluster; # rest to nearest node
}
Scope of Work
Geo-cluster deployment includes: architecture design, deployment of DB replication, Redis cluster, file synchronization, GeoDNS, load balancer, load testing, and disaster recovery drill. We also provide documentation, access credentials, and training for your engineers. Geo-cluster setup project cost: $12,000 to $18,000 depending on complexity. Contact us for a preliminary assessment of your project. We guarantee a custom approach.
Setup Timeline
| Stage | Content | Duration |
|---|---|---|
| Architecture design | Scheme, technology decisions, RPO/RTO agreement | 2–3 days |
| DB replication setup | GTID, lag monitoring, failover test | 2–3 days |
| Redis + sessions setup | Sentinel/Cluster, .settings.php | 1–2 days |
| File synchronization | S3 or rsync + nginx configs | 1–2 days |
| GeoDNS + load balancer | Cloudflare/Route53, split-routing nginx | 1–2 days |
| Load testing and drill | Failover verification, latency measurement | 2–3 days |
Typical problems in multi-region clustering: replication lag >500 ms (solved by optimizing the link and MySQL settings), file conflicts during two-way sync (prevent by prohibiting uploads on regional nodes), Redis split-brain during disconnection (monitoring and manual failover).
Additional Configuration Details
For deeper tuning, refer to the Bitrix cluster documentation Bitrix Cluster Module Guide. The recommended Redis Sentinel setup includes three nodes per region.Geo-cluster deployment is suitable for both 1C-Bitrix websites and Bitrix24 corporate portals. We guarantee a custom approach tailored to your infrastructure.







