How to set up smartphones and PCs. Informational portal
  • home
  • Errors
  • 1c Bitrix web cluster. And also in the boxed version of the service

1c Bitrix web cluster. And also in the boxed version of the service

Today Bitrix presented its new solution - “web cluster”. For those who do not know - I will explain that this thing allows you to place a highly visited project not on one, but on several servers, and at any time add new servers to speed up the site. It is also safe to remove any server for repair, upgrade, or in case of failure. Of course, as their first competitor (represented by Yumisoft), I first of all needed to find out what they were offering the market fundamentally new.

But nothing. In a good way, nothing. Bitrix stopped fooling around and “reinventing the wheel” - apparently, a smart technologist got into the team, so instead of “bicycles” they took and did everything as it is customary to do with normal people. In this post I will tell you in simple words - what exactly they did and how you can repeat the same thing in your project.

Let's consider the main parts of the cluster:

0. Cloud - a cloud, a set of servers on which all this will spin.
1. Load balancer - incoming load balancer.
2. MySQL replication is a popular type of database clustering.
3. Network file system - distributed file storage.

As mentioned above, a cluster is a collection of an arbitrary number of web servers. They can perform the same task, or different depending on the goals. Let's start with the servers: here it is proposed to use aws.amazon.com virtual machines for them. I would not say that this is a reasonable solution: virtual machines are a priori slow, but the key point here is the simplicity of their creation. I pressed the button - it was created. And not a default machine, but customized specifically for your needs. It can be created on a schedule or even dynamically as the load grows. Your site got under a powerful stream of visitors - it rrrr-az and created several new machines. When the load is over, the machines are disconnected. The beauty.

Of course, any servers on the Internet can act as cluster servers: either virtual or iron. For reference: any person who is not too lazy to start the installation of a fresh distribution kit of Ubuntu Server can make his own personal "Amazonian" cluster for free.

The balancer is needed in order to distribute the incoming requests of site visitors between the cluster servers. It is suggested to use nginx as it, google “nginx load balance” and get a bunch of links to ready-made examples.

Database replication is needed in order to write data on one server (it is called master - master), and read them from all others (respectively, slave - slave). Since there are usually few write operations, and many read operations, by simply increasing the number of slaves, you can increase the "capacity" of the project indefinitely. Data from the master to the slaves flows in the background purely by means of MySQL, and the slaves can be added and removed at any time. Google “mysql replication” for instructions.

Distributed file storage is needed so that all servers have the same set of files. If a user has uploaded a picture “somewhere” to one of the servers, then it should appear everywhere. Why? Because information can be transferred to other users from another server. For implementation, the comrades from Bitrix recommend “csync2” - it works in the background and stupidly synchronizes files between servers so that everything is the same everywhere.

Everything. So you've made a cluster. And now - fine tuning:

The very first stumbling block that you will stumble upon when transferring your project (I mean a project to another CMS or a self-written one) to such a model will be in database operations. The bottom line is that the application must be able to distinguish “writing” requests from “reading” requests. In other words, INSERT, UPDATE, DELETE, as well as CREATE, ALTER and DROP need to be done only on the master. SELECT queries can, in principle, be executed anywhere. It will take a significant amount of time to retrain your engine for this way of thinking.

In addition, the Bitrixoids have come up with an interesting thing: since the data from the master to the slaves is leaked with some delay, they taught the system to recognize “critical” writing requests. After such a request, all data until the very end of the execution of php-scripts are taken (SELECT) only from the wizard in order to avoid errors due to that very delay.

The second thought that needs to be considered is the allocation of servers for tasks. It is not necessary to make all servers the same and assign them the same tasks. Let some of them serve, for example, an online store, and the other part collects statistics.

The third thought is memcached clustering. Bitrix brought it to the beginning of its presentation, but you can launch it later. Its advantage is that it binds directly to nginx (remember the first point?) And allows it to serve cached pages (or blocks) actually directly from RAM. Your task - more precisely, the task of your scripts - is to put the cached content in memcached.

How to develop a project on a cluster? A frequent question for representatives of web studios. Yes, just like on a regular server. The cluster will be just one big computer for you, which you log into via ssh in the same way and work.

I am a mentor in IT projects. This means that if you are an owner or a manager, I can help you take new heights. Clean up processes, understand team motivation, implement tools and achieve specific goals. I do not teach how to do business, but only help to get around the generously scattered rake on your way. ...

The course is intended for users administering sites on the 1C-Bitrix: Site Management platform. Well Administrator. Modules allows you to master the methods of performing advanced tasks for the administration of modules that are not related to commercial activities A separate course has been created for modules related to online trading. .

Skills acquired:

  • methods of working with modules of the system of a non-commercial plan;
  • work with special tools: Push & Pull, Messaging service and others;
  • work with modules that ensure communication between users: forum, blogs and others;
  • organization of workflow and business processes;
  • setting up Web analytics tools;
  • other.

Required minimum knowledge to study the course:

  • basic computer literacy and Windows OS skills;
  • basic knowledge of the WWW and the organization of access to the web server;
  • Content manager We believe that you have already completed this course and know a lot about Bitrix. Therefore, there will be much fewer tips in pop-up windows than in the Content Manager course.
    , so as not to get confused in the interface.
  • knowledge of the system within the course Administrator. Base We believe that you have already completed this course and know a lot about the administration of "1C-Bitrix". Therefore, there will be much less prompts in the pop-up windows, as well as explanations of where and how to perform common administration tasks.

It would be nice to have basic skills in installing and administering * nix systems.

If this course is taken as the basis for offline teaching, then the recommended duration is 4 days (32 academic hours).

Save time and study on your way to work or college? This requires files. We provide two offline learning options: PDF and CHM files, which can be opened on any device. Reading software is available in the AppStore and Play Market. The files are updated periodically, but will still lag behind the online version of the course. Therefore, nevertheless, we recommend the on-line version of the courses, especially since the mobile Internet is not a problem now.

Save time and study on your way to work or college? This requires files. We provide two offline learning options: PDF and CHM files, which can be opened on any device. Reading software is available in the AppStore and Play Market. The files are updated periodically, but will still lag behind the online version of the course. Therefore, nevertheless, we recommend the on-line version of the courses, especially since the mobile Internet is not a problem now.

  1. The file is not located locally, but on a network resource.
  2. If the file is on the local disk, but the path to it contains special characters (# and others).

How to take the training course?

1C-Bitrix: Web cluster The main tasks that need to be solved: 1. Ensuring high availability of the service (the so-called HA - High Availability or Failover clusters) 2. Scaling a web project in conditions of increasing load (HP - High Performance clusters) 3. Balancing load, traffic, data between multiple servers. 4.Creating a consistent data backup for MySQL.


1C-Bitrix: Web Cluster "Web Cluster" provides business continuity, fault tolerance, scaling, load balancing. Any new or working project on 1C-Bitrix: Site Management 10.0 can be presented as a web cluster of interchangeable servers. 1.As traffic increases, you can quickly add new servers to the cluster. 2. In case of failure of one of the cluster servers, the system continues to continuously serve the Clients. 3. Balancing load, traffic, data between multiple servers. 4. The system allows you to take backups from specially allocated cluster nodes without affecting the operation of the site.




The history of platform performance Until 2005, the issue of performance was not systematically dealt with for a year - performance became a significant task for development. Year - the appearance of tools for debugging SQL queries. Systematic work on product performance year - the first load testing with QSOFT (1.5 million hits per day for the "Business" edition, 6 million - for the "Start" edition) years - 4 Oracle RAC configurations with 4 servers were deployed a year - "performance monitor "In all editions of the product years -" 1C-Bitrix: Virtual Machine "and" 1C-Bitrix: Web Environment "were released - certification of hosting providers a year - productivity growth - by 430%! New load tests: 8.5 million hits - "Business", 12.4 million - "Start", 85 million - "HTML cache".




Scale options up to Split into two servers: web server + database. 2.Increase in the capacity of the equipment (the more powerful, the more expensive; the increase in cost is not proportional). 3. Allocating a cache to one external server via memcached. 4. Migration to Oracle (minimum license + $ 5000 per processor). 5. Creation of Oracle RAC (Real Application Cluster). Project - about $ (equipment + license + "general shelf"). There are very few specialists. For most clients, the performance is sufficient, but the problems of fault tolerance, redundancy, network availability are not solved.


1C-Bitrix: Web cluster "1C-Bitrix: Web cluster" is a combination of technologies: Vertical sharding (transferring modules to separate MySQL servers) MySQL replication (Oracle and MS SQL in the future) and load balancing between servers Distributed data cache ( memcached) Session continuity between web servers (storing sessions in a database) Web server clustering: - File synchronization - Load balancing between servers






Dividing one web application database into two or more databases by allocating separate modules, without changing the logic of the web application: Web analytics Search 1. Efficient load balancing. 2. Scaling. 3. Partitioning large amounts of data. Vertical sharding









Web server MySQL database Web application High load: ~ 10 ^ 3 writes / sec ~ 10 ^ 4 reads / sec High traffic 1) Requests are processed by only one DBMS server 2) CPU and disk subsystem of the DBMS are overloaded Scaling with increasing load MySQL




High efficiency - due to the centralized use of the cache by the web application Reliability - due to the robustness of the caching subsystem to the failure of individual components Unlimited scalability - due to the addition of new memcached servers. memcached 1 memcached 2 memcached 3 Web cluster "1C-Bitrix" 40% 30% Web server Distributed data cache (memcached)



Session continuity between web servers A user session must be transparent to all servers in a web cluster. 1.After authorization on one of the servers, the user should be considered authorized for all other servers. 2. And vice versa - the end of a session on any server should mean its end on all servers at once.


80% High traffic 1) Load is handled by only one web server 2) CPU is overloaded with PHP processing, precompiler is enabled, segmentation faults are observed Task: scale "title =" (! LANG: Web server MySQL database Web application High CPU load > 80% High traffic 1) Load is handled by only one web server 2) CPU is overloaded with PHP processing, precompiler is enabled, segmentation faults are observed Task: scale" class="link_thumb"> 22 !} Web server MySQL database Web application High CPU load> 80% High traffic 1) The load is handled by only one web server 2) The CPU is overloaded with PHP processing, the precompiler is on, segmentation faults are observed Task: scaling with increasing load 80% High traffic 1) Load is handled by only one web server 2) CPU is overloaded with PHP processing, precompiler is enabled, segmentation faults are observed Task: scale "> 80% High attendance 1) Load is handled by only one web server 2) CPU is overloaded with PHP processing , precompiler is on, segmentation faults are observed Task: scaling with increasing load "> 80% High traffic 1) The load is handled by only one web server 2) CPU is overloaded with PHP processing, the precompiler is enabled, segmentation faults are observed Task: scale" title = "(! LANG: Web server MySQL database Web application High CPU load> 80% High traffic 1) The load is handled by only one web server 2) CPU is overloaded with PHP processing, precompiler is on, segmentation faults are observed Objective: scale"> title="Web server MySQL database Web application High CPU load> 80% High traffic 1) The load is handled by only one web server 2) The CPU is overloaded with PHP processing, the precompiler is on, segmentation faults are observed Objective: scale"> !}














Why did we choose csync2? Quick access to application files through the use of local storage. High speed of work. Low resource consumption (CPU, disk operations). These two factors make it possible to run the synchronization process as often as possible, so the data on the servers becomes identical in almost "real time". Easy to configure for data exchange between any number of servers. Ability to sync delete files. Secure communication between hosts (SSL).


Web server MySQL MASTER database "1C-Bitrix: Web cluster" MySQL SLAVE database 1 MySQL SLAVE N database Online backup Disk Integral logical / physical MySQL backup without slowing down the main system MySQL database MASTER candidate DRBD - on-line backup of a disk with a database; Organization of backup - MySQL


Web server "1C-Bitrix: Web Cluster" / var / www LVM / var / www - snapshot 1 / var / www - snapshot 2 / var / www - snapshot 3 Fast, consistent backup at the Linux level Fast, consistent, incremental , automatically consolidated backup using hoster tools. Organization of backup - files


"1C-Bitrix: Web cluster", DC in Moscow DB Web node "1C-Bitrix: Web cluster", DC in New York "1C-Bitrix: Web cluster", DC in Novosibirsk circular, asynchronous, master -master with replication to ensure the operation of geographically distributed web clusters 1C-Bitrix Database Cache Web Node Cache Database Web Node Cache We are working on ...


"1C-Bitrix: Web-cluster", DC in Moscow DB Web-node "1C-Bitrix: Web-cluster", DC in New York "1C-Bitrix: Web-cluster", DC in Novosibirsk circular, asynchronous, master -master with replication to ensure the operation of geographically distributed web clusters 1C-Bitrix Database Cache Web Node Cache DB Web Node Cache DB Web Node Cache DB Web Node Cache DB Web Node Cache DB Web Node Cache DB Web Node Cache DB Web node Cash We are working on ...


System Resilience When Web Cluster Nodes Are Down When cluster nodes are shut down, the system does not interrupt service to clients. The queue grows (the time it takes to deliver pages to clients grows), but the overall system is load balanced. Adding the Web Cluster host back will increase system performance proportionally. Load test - shutdown of one of the cluster nodes

The Web cluster module is a combination of technological solutions that allow you to distribute one site to several servers, thereby solving several problems: ensuring high availability of the site; its scaling under conditions of increasing load; balancing of load, traffic, data between several servers. Build your Web Cluster - increase the performance, scalability and reliability of your project!

Any new or working project on "1C-Bitrix: Site Management" can be presented as a web cluster of interchangeable servers.
The main tasks that such a project configuration can solve:

  • With increasing traffic, you can quickly add new servers to the cluster
  • In case of failure of one of the cluster servers, the system continues to continuously serve Clients
  • Balancing load, traffic, data between multiple servers
  • The system allows you to take backups from specially dedicated cluster nodes without affecting the operation of the site

"Geographic Web Cluster"

Geographic Web Cluster increases project resiliency and provides data center independence. Different data centers combine several groups of web clusters located in different cities or countries. In the event of a failure of one data center, the other is instantly included in the work, without the need to restore the "backup".


Geographic Web Cluster allows you to lift entire groups of servers. Each of these groups has its own master - in data centers independent of each other. Thus, your sites, your business are completely protected from the inaccessibility of the data centers themselves.
1C-Bitrix: Web Cluster is a combination of technologies:

  • Vertical sharding (moving modules to separate MySQL servers)
  • MySQL replication and load balancing between servers
  • Distributed data cache (memcached)
  • Session continuity between web servers (storing sessions in a database)
  • Web server clustering:
  • Synchronizing files
  • Load balancing between servers
  • Independence from the data center (in the event of a failure of one data center, the other is instantly included in the work, without the need to restore the "backup")

How does it work

1. Vertical sharding

Dividing one database of a web application into two or more databases by allocating separate modules, without changing the logic of the web application.

The following product modules can be placed in separate databases:

  • "Web Analytics"
  • "Search"

2. MySQL replication and load balancing between servers

The "master - slave" scheme is implemented using MySQL tools.
The 1C-Bitrix Site Management platform allows you to flexibly balance the load between the servers involved in replication.


Key features:

  • flexible SQL load balancing
  • ease of administration
  • cheap and fast unlimited scaling
  • online backup
  • no need to modify the logic of the web application

3. Distributed data cache (memcached)

"1C-Bitrix: Web Cluster" allows you to use a pool of memcached servers to work with the data cache.

This provides:

  • high efficiency - due to the centralized use of the cache by the web application
  • reliability - due to the stability of the caching subsystem to the failure of individual components
  • unlimited scalability - by adding new memcached servers

4. Continuity of sessions between web servers (storing sessions in a database)

The ability to store user session data in a database provides session transparency for all web servers in the cluster:

  • After authorization on one of the servers, the user must be considered authorized for all other servers.
  • And vice versa - the end of a session on any server should mean its end on all servers at once

5. Clustering a web server


When dividing a project into several web servers, two tasks must be solved:

  • synchronization of data (files) between servers
  • load balancing between servers
Any new or working project on "" can be represented as a web cluster of interchangeable servers.

The main tasks that such a project configuration can solve:

  1. As traffic increases, new servers can be quickly added to the cluster.
  2. In case of failure of one of the cluster servers, the system continues to continuously serve the Clients.
  3. Balancing load, traffic, data between multiple servers.
  4. The system allows you to take backups from specially allocated cluster nodes without affecting the operation of the site.

"Geographic Web Cluster"

Geographic Web Cluster increases project resiliency and provides data center independence. Different data centers combine several groups of web clusters located in different cities or countries. In the event of a failure of one data center, the other is instantly included in the work, without the need to restore the "backup".


Geographic Web Cluster allows you to lift entire groups of servers. Each of these groups has its own master - in data centers independent of each other. Thus, your sites, your business are completely protected from the inaccessibility of the data centers themselves.

1C-Bitrix: Web Cluster is a combination of technologies:

  1. Vertical sharding(moving modules to separate MySQL servers)
  2. MySQL replication and load balancing between servers
  3. Distributed data cache(memcached)
  4. Session continuity between web servers(storing sessions in a database)
  5. Web server clustering:
  • Synchronizing files
  • Load balancing between servers
  • Data center independence(in the event of a failure of one data center, another immediately turns on into operation, without the need to restore a "backup")

  • How does it work

    1. Vertical sharding

    Dividing one database of a web application into two or more databases by allocating separate modules, without changing the logic of the web application.





    The following product modules can be placed in separate databases:

    2. MySQL replication and load balancing between servers

    The "master - slave" scheme is implemented using MySQL tools.

    The 1C-Bitrix Site Management platform allows you to flexibly balance the load between the servers involved in replication.



    Key features:
    • flexible SQL load balancing
    • ease of administration
    • cheap and fast unlimited scaling
    • online backup
    • no need to modify the logic of the web application

    3. Distributed data cache (memcached)

    "1C-Bitrix: Web Cluster" allows you to use a pool of memcached servers to work with the data cache.



    This provides:
    • high efficiency- due to the centralized use of the cache by the web application
    • reliability- due to the stability of the caching subsystem to the failure of individual components
    • unlimited scalability- by adding new memcached servers

    4. Continuity of sessions between web servers (storing sessions in a database)

    The ability to store user session data in a database provides session transparency for all web servers in the cluster:
    1. After authorization on one of the servers, the user should be considered authorized for all other servers.
    2. And vice versa - the end of a session on any server should mean its end on all servers at once.

    Top related articles