📜 ⬆️ ⬇️

The most effective in terms of speed of work - server scheme for client-server 1C 8.x

Foreword

Constantly faced with the statements of IT specialists "the network is loaded by 20% ... processors by 50% ... there are few queues for disks ... So the network and the server are coping ... see the code in 1C problem exclusively there".

In fact, the following happened (1C server and SQL are separated on different computers): the network was practically used to the maximum ( these " 20% of the network interface load " = "20% useful data" + "80% loss on service processing" ). And accordingly, due to the small width of the exchange of “useful” data, the SQL server with the “1C Server” constantly waited for each other, which led to a low utilization of CPU and disk system resources.

Introduction: First I want to focus on what is the 1C platform ?.
')
So let's start with the main 1C - built on the ORM (object-relational mapping) system and the programmer in it works not directly with the relational representation, but with objects.
ru.wikipedia.org/wiki/ORM

The programmer in the 1C environment writes object logic, and the platform itself is responsible for assembling / disassembling and writing objects into a “flat view” using database tables.

Basic "+" and "-" from the point of view of ORM:

"+" A programmer in the ORM environment gains an advantage in the speed of application development due to the reduction in the amount of code and its simplicity compared to exclusively relational program code (example SQL queries). It is also exempt from writing the code that works directly with the entries in the tables of a relational DBMS. * one

"-" Difficulties for creators of ORM "platforms" and performance problems:
Using a relational database to store object-oriented data leads to a “semantic gap”, forcing programmers to write software that must be able to both process the data in an object-oriented form, and be able to store this data in a relational form. This constant need for conversion between two different forms of data not only greatly reduces performance, but also creates difficulties for programmers, since both forms of data impose limitations on each other.


* 1 “Refinement”. Despite the fact that 1C 8.x allows you to work with a relational-like code (read only) in the 1C "Request" object, it is still not directly one-to-one translated into a relational DBMS query to the data storage tables, but before the whole “Object request” is also not passing the assembly stage of disassembling objects. Therefore, often instead of many-thousand lower-case "Object requests" - the most optimal in terms of code performance and development speed is to write an object non-relational-like code.


Chapter 1: Consider the client-server model 1C 8.x



I note the main bottlenecks affecting performance:

1) The first bottleneck is the communication medium of data transmission .
In the figure, arrows show data exchange flows, where “red” is the relational DBMS <-> Object DBMS, “orange” is the synchronization between Object DBMS.
Since when using separate servers for DBMS and 1C clusters, the communication environment is network connections — then there are significant delays in data transmission in numerous small portions, both because of the latency of the physical implementation of the interfaces themselves and because of the latency of the nodes in this network.

Consider the example of a network standard Ethernet Gigabit ( data transfer rate graph ... below )
using the example of 1C Server operation with MS SQL ( by default, the size of communication packets is 4 kb) :



The graph shows that when using DATA packets = 4 kb, the bandwidth of the considered network is only 250 Megabit / s. (as correctly noted in the commentary to the publication: these are not packets of protocols, for example TCP level , but DATA packets that generate applications participating in the exchange)
...
From practice: such separation on Two separate servers
MS SQL (server # 1) <- Ethernet Gigabit ---> 1C Server (server # 1)
lost on the speed of the platform
50% MS SQL (server number 1) <- Shared Memory (without network through a section of memory) ---> “1C Server” (server No. 1) ... and this is “on one high-loaded user session”

2) A bottleneck is the number of individual computers of “1C clusters” , the more of them the greater the cost of synchronization and, as a consequence, the decrease in system performance.

3) A bottleneck is the number of individual server processes 1c , the more of them the greater the cost of synchronizing them ... But then most likely it is necessary to find a middle ground - to ensure stability. 2 *
2 * "Refinement" - for MS Windows there is such a rule:
Processes are more expensive than threads, which means in practical terms the following: the exchange rate between two threads within one process is much higher than the exchange rate between threads that are in different processes.

Therefore, for example, “File 1C 8.x” always exceeds the speed of single-user platform work in a client-server version. It's simple because in the case of “File 1C 8.x”, the stream of the “Relational DBMS” communicates with the stream of the “Objective DBMS” within one single process.



4) The bottleneck is the single thread of the user session , since each individual session — the user session is not parallelized by the platform into several, its operation is limited to using the resources of one CPU core => therefore the maximum speed of each core is desirable, in this case the performance of the 1C platform on a 10-core CPU at 1 GHz will be significantly inferior platforms for 4-core 3 GHz CPU - naturally up to a certain number of streams.

Chapter 2 (Outcome): Consider non-scalable and scalable options — the most efficient schemes for the 1s 8.x platform. for OS Windows (I assume for Linux the situation is similar)



Option 1 (not scalable). Counting on 100 "highly loaded user sessions"

1) the usual 2-socket server with 4-core CPUs of 3 GHz is effective.

2) fast disk system on SSD

3) MS SQL <- Shared memory -> "1C Server"

Option 2 (scalable). starting with 100 “high loaded user sessions” and further ….
It is most logical to follow the path of the German 1c-ki “Sap HANA”))
Assembling a modular "Super Computer" from SGI - consisting of "blades" on 2 socket motherboards, each blade is connected to each other by a complex topology of ultra-fast interconnect based on NUMA chips, and everything is controlled by a single OS. Those. programs inside such a server, by definition, have access to the resources of any "blade".

1) we add “blades” at the required load ... at the rate of approximately one “blade” per 100 users.

2) fast disk system on SSD

3) MS SQL <- Shared memory -> "1C Server"

Source: https://habr.com/ru/post/249501/


All Articles