PHP module for processing data from the 1C platform to the site (Back-end REST Service)
web site interface
The main functionality of the system is the exchange of xml messages between 1C and the data processing module (REST) ​​located on the application server. The processing module receives data from 1C and writes it to the database. The web-interface of the site works with the database.
How to monitor the results?
Zabbix was chosen as the monitoring tool - the most affordable system, which is easy to install and use. Zabbix allowed us not only to monitor the testing process in real-time mode, but also to keep statistics, based on which we can predict the load and calculate the value of RPO (Recovery Point Objective) and RTO (Recovery Time Objective) indicators, as well as system availability ( Agreed Service Time ).
How to test?
Since the system can be divided into two main parts, we will try to identify possible flaws in them. The first is the interaction of the 1C gateway and the XML handler on the web. The second is user interaction with the database through a web interface. So let's get started:
Testing exchange 1C-Site To begin, let us take into account that the “narrowest” place of exchange can be detected when you first unload all the objects necessary for the system to work from 1C base to the web. Since there was no 1C base with a sufficient number of objects at hand, we wrote a script to create an extended list of nomenclature and counterparties in 1C with preservation of all necessary connections. As a result of the script, 200 thousand objects appeared in the database.
So, setting up the exchange and checking everything again, we start a full download from 1C to the web and look at the graphs.
Results: The initial unloading of goods lasted at about 9 o'clock. The bottleneck when unloading a large amount of data from 1C is the performance of the 1C gateway, which is directly related to server capacity and platform limitations. They also revealed the problem of exchange, which is to be resolved in the shortest possible time - the absence of unloading from 23:00 to 02:00.
The next stage of testing will be the creation of an ideal stand with unlimited 1C server capacities and a “wide” communication channel. Testing has shown that at this stage it is necessary to pay particular attention to optimizing the 1C code and test the two-way exchange in different load modes. In the near future, a comprehensive study of this issue is scheduled, following which the 2nd article will be written.
Testing the web interface
The purpose of this test is to count the number of simultaneously working users that the system can efficiently maintain. To begin, we define the concept of "effective." We assume that “efficiency” is achieved in the case when the loading time of an arbitrary page is no more than one second. The ping time to our test server does not exceed 55ms.
For load testing, they decided to use such systems as Apache Benchmark and Tsung.
Apache benchmark 100 users, 10 of whom simultaneously make a request using the search engine site.
ab-n 100 -c 10 -uputdata.txt-esearch.csv _
Putdata.txt - contains words that are entered into the search form. The result writes a search.csv file.
Result: 98% of requests were processed within 1 second.
Tsung
Create a script using the tsung-record utility. Tsung-record records client actions through a proxy server - Tsung Proxy. It remains to register the proxy server address in the browser -127.0.0.1 and port 8090, which will listen to requests.
And in the terminal execute the tsung-record – star command
Open the browser and perform the usual user actions: â—Ź Browse categories of goods; â—Ź We carry out the order of goods; â—Ź We use the search; â—Ź Add a new product to the order;
Having finished working in the browser, we stop the tsung-recorder with the stop command.
As a result, a file was created containing the Get requests:
After performing load testing, you can generate a log report using the tsung-report command.
Charts in Zabbix (time from 14:30 - 14:50):
Result: The system works stably with 300 users simultaneously working with its interface. At the same time the formation of the page for each user does not exceed 1 second.
The results obtained at this stage of development, in our opinion, are quite acceptable for systems of this kind. However, we identified a number of important problems that need to be solved and once again became convinced of the need to improve the system.