Cluster configuration method and its device, equipment, medium, and product
The cluster configuration method uses a performance evaluation formula to estimate search performance, addressing inefficiencies in existing methods by predicting cluster performance before scaling, thus optimizing resource allocation.
Patent Information
- Application Number
- CN202210473900.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-04-29
AI Technical Summary
Existing e-commerce platforms lack a method to estimate search performance of clusters before expansion or reduction, necessitating stress testing after the fact, which is inefficient and resource-intensive.
A cluster configuration method using a preset performance evaluation formula to calculate search performance data based on initial and target cluster configurations, incorporating adjustment coefficients and index instance shards, allowing for efficient estimation of required nodes for expansion or reduction.
Enables accurate prediction of search performance without extensive stress testing, facilitating rational resource planning and avoiding unnecessary resource waste by optimizing cluster configurations.
Smart Images

Figure CN114880071B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of e-commerce network technology, and in particular to a cluster configuration method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In e-commerce platforms, there are numerous e-commerce products for sale. When users want to learn about or buy the products they want, they will mostly use the product search service. Therefore, the corresponding product search service is one of the most frequently called and very important services in e-commerce service platforms.
[0003] In order to provide users with product search services, e-commerce service platforms generally use cluster technology to implement the product search service. When the e-commerce service platform holds a product promotion, in order to cope with high traffic and high concurrency, it is necessary to expand the cluster to enhance the service capabilities of the product search service. After the product promotion, it is necessary to reduce the capacity of the expanded cluster to save system resources and achieve reasonable planning of computing resources to cope with corresponding application scenarios.
[0004] In traditional technology, in order to obtain data corresponding to the search performance after the cluster is expanded or reduced in capacity, it is usually necessary to stress test the cluster after the expansion or reduction operation. There is still no method to estimate the corresponding search performance of the cluster after the change before the expansion or reduction operation.
[0005] With regard to the deficiencies in the prior art, the applicant has made corresponding explorations. Summary of the invention
[0006] The primary purpose of the present application is to solve at least one of the above problems and to provide a cluster configuration method and its corresponding apparatus, computer equipment, computer-readable storage medium, and computer program product.
[0007] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0008] A cluster configuration method provided to meet one of the purposes of this application includes the following steps:
[0009] Acquire initial cluster configuration information, where the cluster configuration information includes the number of nodes corresponding to the product search service;
[0010] Based on the initial cluster configuration information, the number of nodes therein is changed to obtain multiple target cluster configuration information;
[0011] Applying a preset performance evaluation formula to calculate cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient;
[0012] The target cluster configuration information corresponding to the cluster search performance data meeting the preset conditions is selected to configure the number of nodes required for the commodity search service.
[0013] In a further embodiment, before the step of applying the preset performance evaluation formula, the following steps are included:
[0014] The performance evaluation formula is constructed so that the cluster search performance data corresponding to the number of nodes of a given target cluster configuration information is calculated in the performance evaluation formula according to the total number of index instances of the data set of the commodity search service, the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node, and a preset adjustment coefficient.
[0015] In a further embodiment, constructing the performance evaluation formula comprises the following steps:
[0016] Deploy the test dataset into multiple index instances and shard them to multiple nodes;
[0017] According to the data capacity of the test data set, a preset search performance function is called to calculate the maximum query rate per second corresponding to each shard, wherein the search performance function represents the mapping relationship between the data set capacity and the maximum query rate per second;
[0018] Calculate the average number of shards per node;
[0019] Execute a product search service on the test data in the test data set to implement a search stress test, and obtain a corresponding maximum query rate per second of the cluster;
[0020] The adjustment coefficient is fitted based on the corresponding relationship between the corresponding maximum query rate per second of the service cluster and the comprehensive product of the average maximum query rate per second of each shard and the total number of index instances;
[0021] The performance evaluation formula is determined, and the performance evaluation formula calculates the estimated maximum query rate per second of the cluster as the cluster search performance data by the product of the maximum query rate per second, the comprehensive product and the adjustment coefficient.
[0022] In a further embodiment, before the step of deploying the test data set to multiple nodes by sharding multiple index instances, the following steps are included:
[0023] The preset test data set is split into single index instances and deployed to multiple nodes;
[0024] Performing a search stress test on the test data set to obtain a corresponding maximum query rate per second of the cluster;
[0025] According to the corresponding relationship between the data capacity of the test data and the maximum query rate per second obtained by the search stress test, a search performance function under a single index instance is constructed.
[0026] In a further embodiment, applying a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient includes the following steps:
[0027] Adjusting the deployment of the cluster's index instances and their shards according to the number of nodes in the target cluster configuration information;
[0028] Determine the total number of index instances after the adjustment deployment and the average number of shards per node;
[0029] A preset performance evaluation formula is called to determine cluster search performance data according to the total number of index instances and the average number of shards.
[0030] In a further embodiment, after the step of selecting the target cluster configuration information corresponding to the cluster search performance data meeting the preset conditions for configuring the number of nodes required for the commodity search service, the following steps are included:
[0031] Configuring the number of nodes required by the product search service according to the selected target cluster configuration information to achieve expansion or reduction of computing resources of the product search service;
[0032] In response to a product search request, the product search service is called to obtain search results corresponding to the request;
[0033] The product search request is responded to with the search result.
[0034] A cluster configuration device provided to meet one of the purposes of the present application includes: an initial configuration acquisition module, a target configuration acquisition module, a search performance evaluation module, and a configuration node module, wherein the initial configuration acquisition module is used to obtain initial cluster configuration information, the cluster configuration information including the number of nodes corresponding to a commodity search service; the target configuration acquisition module is used to obtain multiple target cluster configuration information by changing the number of nodes in the initial cluster configuration information; the search performance evaluation module is used to apply a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient; the configuration node module is used to select the target cluster configuration information corresponding to the cluster search performance data that meets preset conditions for configuring the number of nodes required for the commodity search service.
[0035] In a further embodiment, before the search performance evaluation module, there is also: a formula construction module, which is used to construct the performance evaluation formula, so that in the performance evaluation formula, the cluster search performance data corresponding to the number of nodes of the given target cluster configuration information is calculated according to the total number of index instances of the data set of the commodity search service and the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node and a preset adjustment coefficient.
[0036] In a further embodiment, the formula construction module includes: a shard deployment submodule, which is used to shard and deploy the test data set to multiple nodes with multiple index instances; a shard search performance calculation submodule, which is used to call a preset search performance function to calculate the corresponding maximum query rate per second for each shard based on the data capacity of the test data set, and the search performance function represents the mapping relationship between the data set capacity and the maximum query rate per second; a shard number calculation submodule, which is used to calculate the average number of shards for each node; a cluster search performance acquisition module, which is used to perform a commodity search service on the test data in the test data set to implement a search stress test and obtain the corresponding maximum query rate per second of the cluster; an adjustment coefficient fitting submodule, which is used to fit the adjustment coefficient based on the corresponding relationship between the corresponding maximum query rate per second of the service cluster and the comprehensive product of the average maximum query rate per second of each shard and the total number of index instances; a performance evaluation formula determination submodule, which determines the performance evaluation formula, which calculates the corresponding estimated maximum query rate per second of the cluster as the cluster search performance data by the product of the maximum query rate per second, the comprehensive product and the adjustment coefficient.
[0037] In a further embodiment, before the sharding deployment submodule, there are: a sharding deployment submodule, which is used to deploy a preset test data set into single-index instance shards to multiple nodes; a search performance acquisition submodule, which is used to perform a search stress test on the test data set to obtain the corresponding maximum query rate per second of the single-index instance shard; and a search performance function construction submodule, which is used to construct a search performance function of the single-index instance shard based on the correspondence between the data capacity of the test data and the maximum query rate per second obtained by the search stress test.
[0038] In a further embodiment, the search performance evaluation module includes: a shard deployment submodule, used to adjust the deployment of the cluster's index instances and their shards according to the number of nodes in the target cluster configuration information; a variable confirmation submodule, used to determine the total number of index instances after the adjusted deployment and the average number of shards corresponding to the unit node; a cluster search performance determination submodule, used to call a preset performance evaluation formula to determine the cluster search performance data based on the total number of index instances and the average number of shards.
[0039] In a further embodiment, after the configuration node module, there is also: a capacity expansion and contraction module, which is used to configure the number of nodes required by the product search service according to the selected target cluster configuration information, so as to achieve the expansion or contraction of the computing resources of the product search service; a request response module, which is used to respond to the product search request and call the product search service to obtain the search results corresponding to the request; and a request reply module, which is used to reply to the product search request with the search results.
[0040] A computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the cluster configuration method described in the present application.
[0041] A computer-readable storage medium is provided to meet another purpose of the present application. The computer program implemented according to the cluster configuration method is stored in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.
[0042] A computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any embodiment of the present application.
[0043] It can be known from the typical embodiments of the present application that the technical solution of the present application has many advantages, including but not limited to the following aspects:
[0044] This application can estimate the search performance of the cluster through a preset performance evaluation formula without the need for a large number of corresponding stress tests. It is convenient and efficient and can estimate the corresponding search performance after the change before scaling the cluster, thereby providing a reliable decision-making basis for the configuration of cluster resources.
[0045] Furthermore, before scaling the cluster, the corresponding search performance after the change can be estimated, and the number of nodes required for the product search service can be configured accordingly to achieve expansion or reduction of the computing resources of the product search service, and rationally plan the computing resources so that the planned computing resources can both meet the product search service and avoid unnecessary waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0047] Figure 1 A flowchart of a typical embodiment of the cluster configuration method of the present application;
[0048] Figure 2A schematic diagram of a process for constructing a performance evaluation formula in an embodiment of the present application;
[0049] Figure 3 A flowchart of constructing a search performance function for a single index instance shard in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of a process for calling a preset performance evaluation formula to determine search performance data of a cluster corresponding to target cluster configuration information in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a process for rationally planning computing resources of a product search service in an embodiment of the present application to respond to corresponding product search requests;
[0052] Figure 6 This is a principle block diagram of the cluster configuration device of the present application;
[0053] Figure 7 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0054] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0055] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0056] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0057] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.
[0058] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0059] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.
[0060] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.
[0061] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.
[0062] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.
[0063] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.
[0064] A cluster configuration method of the present application can be programmed as a computer program product and deployed in a client or server for execution. For example, in the e-commerce platform application scenario of the present application, it is generally deployed in a server for implementation. The method can be executed by accessing an interface opened after the computer program product is running and performing human-computer interaction with the process of the computer program product through a graphical user interface.
[0065] See also Figure 1 In a typical embodiment, the cluster configuration method of the present application includes the following steps:
[0066] Step S1100: Acquire initial cluster configuration information, where the cluster configuration information includes the number of nodes corresponding to the commodity search service;
[0067] In order to provide users with product search services so that users can search for products, the e-commerce service platform generally uses cluster technology to implement the product search service. The corresponding cluster is a group of independent computers interconnected by a high-speed network. They form a group and are managed in a single system mode. When the cluster provides the product search service to users, the cluster is equivalent to an independent server in the e-commerce service platform. Therefore, software engineering technicians need to configure the cluster, including but not limited to the number of computers corresponding to the computing power required to provide the product search service, that is, the number of nodes. The product database of the e-commerce service platform is stored in the cluster. Here, the product information of the product database can be divided into multiple shards as indexes in a distributed storage manner, and distributed and stored in each node in the cluster to form a distributed search method to provide product search services in response to corresponding product search requests. After the configuration of the cluster is completed, it can be put into use in the e-commerce service platform to provide product search services to users.
[0068] The data access interface provided by the e-commerce service platform for the cluster providing the product search service is called to obtain the current configuration information of the cluster, i.e., the initial cluster configuration information. The cluster configuration information includes the computing resources configured in the cluster for providing the product search service, i.e., the number of nodes. The node is created by a computer that provides computing power for the cluster, usually a container or virtual machine provided by a microservice architecture, but can also be a complete computer device.
[0069] Step S1200, based on the initial cluster configuration information, the number of nodes therein is changed to obtain multiple target cluster configuration information;
[0070] In one embodiment, when an e-commerce service platform holds a big product promotion, such as the most common shopping carnival festivals such as Double Eleven, Double Twelve, and June 18, it can be understood that the user traffic at this time is very large, and the number of product search requests triggered by users that need to be responded to at the same time is also very large. In order for the e-commerce service platform not to collapse due to overload and to be able to provide corresponding product search services for the high traffic and high concurrency in this scenario, it is necessary to reasonably plan the computing resources of the cluster and put them into use, and estimate the number of nodes required to expand the cluster of the e-commerce service platform, reconfigure the cluster corresponding to the initial cluster configuration information, and increase the number of nodes in the cluster. It can be understood that the specific number of nodes that need to be added depends on whether the search performance of the cluster corresponding to the corresponding changed cluster configuration information can support the product search service. Therefore, it is necessary to estimate multiple expansion changes, such as adding 3 nodes, adding 5 nodes, adding 9 nodes, etc., and obtain the cluster configuration information corresponding to the multiple expansion changes as the multiple target cluster configuration information.
[0071] In another embodiment, after the e-commerce service platform holds a big product promotion, it can be understood that the current user traffic drops sharply compared to when the promotion is held, and stabilizes to a normal smaller user traffic, and the number of product search requests triggered by users that need to be responded to at the same time also drops sharply, and stabilizes to a normal smaller number of requests. In order to save the computing resources of the e-commerce service platform and avoid unnecessary waste, it is necessary to reasonably plan the computing resources of the cluster and put them into use, and the number of nodes required to be reduced in the cluster of the e-commerce service platform is estimated, and the cluster corresponding to the initial cluster configuration information is reconfigured to reduce the number of nodes in the cluster. It can be understood that the specific number of nodes that need to be reduced depends on whether the search performance of the cluster corresponding to the corresponding changed cluster configuration information can support the product search service. Therefore, it is necessary to estimate multiple reduction changes, such as reducing 3 nodes, reducing 5 nodes, reducing 9 nodes, etc., and obtain the cluster configuration information corresponding to the multiple reduction changes as the multiple target cluster configuration information.
[0072] Step S1300: applying a preset performance evaluation formula to calculate cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient;
[0073] According to the previous step, each target cluster configuration information includes target cluster configuration information corresponding to the estimated capacity expansion or target cluster configuration information corresponding to the estimated capacity reduction.
[0074] A preset performance evaluation formula is applied, which includes the maximum search performance corresponding to a single index instance shard in a single node in the cluster, the total number of index instances, and the adjustment factor. The performance evaluation formula is:
[0075]
[0076] Where: C avg is the average number of shards corresponding to a unit node, q1 is the maximum query rate per second corresponding to a single index instance shard, C replica +1 is the total number of index instances, x is the adjustment coefficient, and qps is the corresponding maximum query rate per second of the cluster, which represents the search performance of the cluster.
[0077] In one embodiment, the performance evaluation formula is applicable to the search performance evaluation of a cluster using the Elasticsearch search engine. Those skilled in the art should know that in one embodiment, a small amount of search stress testing can be performed on the clusters corresponding to the cluster configuration information corresponding to the expansion and contraction, respectively, to obtain the adjustment coefficient. In addition, the index instance is an index corresponding to the commodity information of the commodity database distributed and stored in the cluster to support commodity search services, and a copy is created for the index instance. Therefore, the total number of index instances is the number of index instances plus the number of copies corresponding to the index instances. The average number of shards corresponding to the corresponding unit node and the total number of indexes can be obtained according to the target cluster configuration information. The maximum query rate per second corresponding to the single index instance shard can be obtained by performing a certain search stress test on the cluster corresponding to the initial cluster information. In addition, it can be understood that the search performance corresponding to the single index instance shard in each node in the cluster is limited by the single index instance shard stored in each node and the corresponding single shard maximum query rate per second, that is, the q1 / C avg Based on this, the search performance data of the cluster corresponding to the target cluster configuration information can be estimated through the preset performance evaluation formula.
[0078] The preset performance evaluation formula will be further disclosed in the subsequent embodiments, and this step will be omitted for the time being.
[0079] Step S1400: Select target cluster configuration information corresponding to cluster search performance data that meets preset conditions to configure the number of nodes required for the commodity search service.
[0080] The preset conditions are used to determine the cluster search performance required for the commodity search service, and can be flexibly set by computing personnel in this field according to actual business needs. Accordingly, the target cluster configuration information corresponding to the cluster search performance data that meets the preset conditions is selected according to the preset conditions, and the number of nodes required for the commodity search service is configured according to the corresponding number of nodes, and the number of nodes corresponding to the initial cluster configuration information is increased or decreased to expand or shrink the cluster corresponding to the initial cluster configuration information accordingly, so as to achieve reasonable planning of the computing resources required for the commodity search service.
[0081] It can be known from the typical embodiments of the present application that the technical solution of the present application has many advantages, including but not limited to the following aspects:
[0082] This application can estimate the search performance of the cluster through a preset performance evaluation formula without the need for a large number of corresponding stress tests. It is convenient and efficient and can estimate the corresponding search performance after the change before scaling the cluster, thereby providing a reliable decision-making basis for the configuration of cluster resources.
[0083] Furthermore, before scaling the cluster, the corresponding search performance after the change can be estimated, and the number of nodes required for the product search service can be configured accordingly to achieve expansion or reduction of the computing resources of the product search service, and rationally plan the computing resources so that the planned computing resources can both meet the product search service and avoid unnecessary waste of resources.
[0084] In a further embodiment, before step S1300, the step of applying a preset performance evaluation formula, the following steps are included:
[0085] Step S1210, construct the performance evaluation formula so that in the performance evaluation formula, the cluster search performance data corresponding to the number of nodes of the given target cluster configuration information is calculated according to the total number of index instances of the data set of the commodity search service and the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node and a preset adjustment coefficient.
[0086] The performance evaluation formula is:
[0087]
[0088] Where: C avg is the average number of shards corresponding to a unit node, q1 is the maximum query rate per second corresponding to a single index instance shard, C replica +1 is the total number of index instances, x is the adjustment coefficient, and qps is the corresponding maximum query rate per second of the cluster, which represents the search performance of the cluster.
[0089] The average number of shards corresponding to the unit node is calculated by the following exemplary formula:
[0090] C avg =(C shard +C replica *C shard ) / C node
[0091] Where: C avg is the average number of shards corresponding to a unit node, C shard is the total number of shards for a single index instance, C replica is the number of index instance replicas, C nodeThe number of nodes in the target cluster configuration information.
[0092] The maximum query rate per second corresponding to a single index instance shard is calculated using the following formula:
[0093] q1=f(m1)
[0094] Among them: q1 is the maximum query rate per second corresponding to the single index instance shard, and m1 is the data volume corresponding to the single index instance shard.
[0095] Those skilled in the art should know that, generally speaking, the data set of the product search service, that is, the product information of the product database stored in the cluster for providing the product search service, is used as the index instance in the cluster. The index instance can be sharded according to the number of nodes in the cluster so that the divided main shard, that is, the single index instance shard, is evenly distributed on each node in the cluster, and each node obtains a single index instance shard. It can be understood that the single index instance shard in each node in the cluster, that is, the entire index instance, can enable the cluster to provide a complete product search service to the outside world. The search performance corresponding to the single index instance shard in each node in the cluster is limited by the maximum query rate per second of the single shard corresponding to the single index instance shard stored in each node, which has an impact on the search performance of the cluster. In terms of search performance, it is the search performance corresponding to the index instance in the cluster multiplied by the total number of index instances. Generally, for the reliability of the cluster, a copy of the index instance will be set. Therefore, the total number of index instances in the cluster is the number of index instances (generally 1 here) plus the number of index instance copies. It can be understood that the maximum query rate per second of the cluster's search performance is the maximum query rate per second of a single shard corresponding to a single index instance shard stored in each node, multiplied by the total number of index instances and then multiplied by the adjustment coefficient. The adjustment coefficient is set to make appropriate adjustments to adapt to the expansion and contraction changes of the cluster. It can be obtained by technical personnel in this field based on prior knowledge or experimental stress test debugging. Thus, the performance evaluation formula is constructed, so that the corresponding cluster search performance data under the given number of nodes of the target cluster configuration information can be calculated accordingly.
[0096] The maximum query rate per second corresponding to the single index instance shard is further disclosed in the subsequent embodiments and is not described in this step for the time being.
[0097] In this embodiment, by constructing a performance evaluation formula, it is possible to quickly and accurately estimate the search performance of the cluster after the change before scaling the cluster, so as to facilitate the subsequent scaling of the cluster and rationally plan the use of computing resources.
[0098] See also Figure 2 In a further embodiment, step S1210, constructing the performance evaluation formula, comprises the following steps:
[0099] Step S1211, deploy the test data set into multiple index instance shards to multiple nodes;
[0100] The test data set is the cluster configuration information of the Elasticsearch search engine cluster. The cluster configuration information can be flexibly configured by those skilled in the art to serve as a test in this embodiment, and corresponding cluster configuration information needs to be set for both expansion and reduction.
[0101] Those skilled in the art should know that the cluster uses an Elasticsearch search engine, including multiple Elasticsearch instances. A running Elasticsearch instance is called a node, and the cluster is composed of one or more nodes with the same cluster name configuration, which share the pressure of data and load, that is, they share the commodity information of the commodity database that provides the commodity search service stored in the cluster, and share the load to provide the commodity search service and respond to corresponding commodity search requests. Generally speaking, the commodity information of the commodity database is used as the index instance of the cluster, and then the Elasticsearch search engine can automatically shard the index instance into multiple index instances. The specific number of shards here can be flexibly changed by those skilled in the art as needed, and the shards of the single index instance are evenly deployed to each node in the cluster. For the copies of the index instance, the multi-index instance sharding can be used in the same way, and the copies corresponding to the shards of the single index instance are evenly deployed to each node in the cluster, but it is necessary to ensure that the copies corresponding to the single index instance shards in each node in the cluster are not in the same node.
[0102] Step S1212: according to the data capacity of the test data set, calling a preset search performance function to calculate the maximum query rate per second corresponding to each shard, wherein the search performance function represents the mapping relationship between the data set capacity and the maximum query rate per second;
[0103] The maximum query rate per second corresponding to a single index instance shard is the maximum query rate per second corresponding to each shard. The preset search performance function exemplary example formula is:
[0104] q1=f(m1)
[0105] Wherein: q1 is the maximum query rate per second corresponding to the single index instance shard, m1 is the amount of data corresponding to the single index instance shard, and the f function generally performs a search stress test on the single index instance shard according to the amount of data corresponding to the single index instance shard, and tests the corresponding maximum query rate per second corresponding to the single index instance shard to obtain the function. A person skilled in the art here can obtain the f function according to the disclosure herein, or flexibly set the f function according to prior knowledge.
[0106] Those skilled in the art will appreciate that the data volume of the single index instance shard in the corresponding cluster can be determined based on the data capacity of the test data set, and the preset search performance function can be called to calculate the corresponding maximum query rate per second of the single index instance shard.
[0107] Step S1213, calculate the average number of shards for each node;
[0108] The average number of shards corresponding to a unit node in the cluster, with an example calculation formula:
[0109] C avg =(C shard +C replica *C shard ) / C node
[0110] Where: C avg is the average number of shards corresponding to a unit node, C shard is the total number of single-index instance shards in the cluster, C replica is the number of index instance replicas, C node is the number of nodes in the cluster.
[0111] Thus, the average number of shards corresponding to the unit node in the cluster is calculated.
[0112] Step S1214: Execute a product search service on the test data in the test data set to implement a search stress test, and obtain a corresponding maximum query rate per second of the cluster;
[0113] The cluster is used to simulate the response of the product search request generated by triggering the execution of the product search service on the e-commerce service platform to the test data in the test data set, so as to implement the search stress test of the cluster, thereby obtaining the corresponding search performance of the cluster.
[0114] Step S1215, fitting an adjustment coefficient according to the corresponding relationship between the corresponding maximum query rate per second of the service cluster and the comprehensive product of the average maximum query rate per second of each shard and the total number of index instances;
[0115] The performance evaluation formula is:
[0116]
[0117] Where: C avg is the average number of shards corresponding to a unit node, q1 is the maximum query rate per second corresponding to a single index instance shard, C replica +1 is the total number of index instances, x is the adjustment coefficient, and qps is the corresponding maximum query rate per second of the cluster, which represents the search performance of the cluster.
[0118] According to the performance evaluation formula, it is not difficult to understand that the maximum query rate per second of the service cluster, i.e., qps, and the average maximum query rate per second of each shard, i.e., q1 / C, can be used to calculate the performance evaluation formula. avg The total number of index instances, i.e., C replica +1 to fit the adjustment coefficient.
[0119] Step S1216: determine the performance evaluation formula, which calculates the estimated maximum query rate per second of the cluster as the cluster search performance data by using the product of the maximum query rate per second, the comprehensive product and the adjustment coefficient.
[0120] Based on the disclosure of the previous step, after determining the adjustment coefficient in the performance evaluation formula, the performance evaluation formula can be further determined. Based on this, the search performance data of the cluster, that is, the corresponding estimated maximum query rate per second, can be calculated by multiplying the average maximum query rate per second of each shard by the total number of index instances and the product of the adjustment coefficient.
[0121] In this embodiment, the specific construction process of the performance evaluation formula is disclosed. The performance evaluation formula constructed in this way can reliably estimate the search performance of the cluster, so that the search performance of the cluster does not need to be estimated through corresponding stress testing, but can be estimated through the performance evaluation formula. This is convenient and efficient, and has forward-looking characteristics. It can estimate the corresponding search performance after the change before expanding or reducing the cluster.
[0122] See also Figure 3 In a further embodiment, before step S1211, deploying the test data set to multiple nodes by sharding multiple index instances, the following steps are included:
[0123] Step S1201: deploy a preset test data set into single index instance shards to multiple nodes;
[0124] The preset test data set is used as the index instance in the cluster, and the number of single index instance shards divided from the multi-index instance sharding of the index instance is set to obtain corresponding single index instance shards, so that the divided single index instance shards are evenly distributed on each node in the cluster, and each node obtains a single index instance shard.
[0125] Step S1202: Perform a search stress test on the test data set to obtain the corresponding maximum query rate per second of a single index instance shard;
[0126] The cluster is used to simulate the response of the product search request generated by triggering the execution of the product search service on the e-commerce service platform to the test data in the test data set, so as to implement the cluster search stress test, thereby obtaining the corresponding maximum query rate per second of the single index instance shard.
[0127] Step S1203: construct a search performance function for a single index instance shard based on the corresponding relationship between the data capacity of the test data and the maximum query rate per second obtained by the search stress test.
[0128] According to the corresponding relationship between the data capacity of the test data and the maximum query rate per second obtained by the search stress test, a function expression between the two can be determined, and then a search performance function of a single index instance shard can be constructed. The exemplary formula is as follows:
[0129] q=f(m)
[0130] Wherein: q is the maximum query rate per second corresponding to the single index instance shard, m is the amount of data corresponding to the single index instance shard, and f function is the function expression between the two.
[0131] In this embodiment, a search performance calculation formula corresponding to a single index instance shard in a cluster is disclosed, wherein corresponding stress testing is performed on the single index instance shard to ensure the accuracy of the search performance calculation formula.
[0132] See also Figure 4 In a further embodiment, step S1300, applying a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient, includes the following steps:
[0133] Step S1310: adjusting the deployment of the index instance of the cluster and its shards according to the number of nodes in the target cluster configuration information;
[0134] Those skilled in the art should be aware that the cluster uses an Elasticsearch search engine and includes multiple Elasticsearch instances. A running Elasticsearch instance is called a node, and the cluster is composed of one or more nodes configured with the same cluster name. They share the pressure of data and load, that is, they share the commodity information of the commodity database stored in the cluster that provides the commodity search service, and share the load of providing the commodity search service and responding to corresponding commodity search requests. When a node is added to the cluster or removed from the cluster, that is, the cluster is expanded or reduced in capacity, the cluster will redistribute all data evenly. Therefore, generally speaking, according to the number of nodes in the target cluster configuration information, the Elasticsearch search engine will automatically adjust the deployment of the index instance and its shards allocated to each node for the cluster. For example, the initial cluster configuration information corresponding to the cluster includes 5 nodes, and the index instance of the cluster is the product information of the product database. The corresponding index instance has a copy of the index instance. Therefore, the index instance and the index instance copy are sharded to obtain 5 single index instance shards and 5 corresponding replica shards. The shard deployment is to evenly distribute the single index instance shard and its corresponding replica shard to each node in the cluster, so that each node is allocated a single index instance shard and a replica shard of the single index instance shard, and the single index instance shard allocated in each node and the corresponding replica shard are not in the same node. Further, If the number of nodes in the target cluster configuration information is greater than the number of nodes in the current cluster, it is expansion, otherwise it is reduction. According to the number of nodes in the target cluster configuration information, the Elasticsearch search engine will automatically adjust the cluster. Generally speaking, for expansion or reduction, the index instance and the index instance replica are re-sharded corresponding to the increased or decreased number of nodes. For example, if the number of nodes increased is 9 nodes, 14 single index instance shards and 14 replica shards of the single index instance shards are obtained by re-sharding; if the number of nodes reduced is 1 node, 4 single index instance shards and 4 replica shards of the single index instance shards are obtained by re-sharding. The shards are deployed by evenly distributing the single index instance shards and their corresponding replica shards to each node in the cluster, so that each node is allocated a single index instance shard and a replica shard of the single index instance shard, and the single index instance shard allocated to each node and its corresponding replica shard are not in the same node.
[0135] Step S1320: Determine the total number of index instances after the adjustment deployment and the average number of shards corresponding to the unit node;
[0136] According to the disclosure of the previous step, the total number of index instances after the adjustment deployment can be determined, which includes the number of index instance copies, and the total number of single index instance shards after the adjustment deployment can be determined. Further, according to the number of nodes in the target cluster configuration information, the total number of single index instance shards, and the number of index instance copies, the average number of shards corresponding to the unit node is determined. The exemplary example formula is:
[0137] C avg =(C shard +C replica *C shard ) / C node
[0138] Where: C avg is the average number of shards corresponding to a unit node, C shard is the total number of shards for a single index instance, C replica is the number of index copies, C node The number of nodes in the target cluster configuration information.
[0139] Step S1330: Call a preset performance evaluation formula to determine cluster search performance data based on the total number of index instances and the average number of shards.
[0140] Through the disclosure of steps S1211-S1216, the preset performance evaluation formula is:
[0141]
[0142] Where: C avg is the average number of shards corresponding to the unit node, i.e., the average number of shards, q1 is the maximum query rate per second corresponding to the shard of a single index instance, C replica +1 is the total number of index instances, x is the adjustment coefficient, and qps is the corresponding maximum query rate per second of the cluster, which represents the search performance of the cluster.
[0143] Furthermore, it can be seen from this disclosure that q1 and x in the preset performance evaluation formula are determined parameters.
[0144] It can be understood that by substituting the total number of index instances, i.e., the average number of shards, corresponding to the target cluster configuration information determined in steps S1310-1320 into the performance evaluation formula, the cluster search performance data, i.e., the corresponding maximum query rate per second, corresponding to the target cluster configuration information can be determined.
[0145] In this embodiment, the estimation of the corresponding search performance before and after the cluster expansion and contraction is disclosed, and a performance evaluation formula can be used to greatly improve the efficiency of cluster performance evaluation.
[0146] See also Figure 5In a further embodiment, after step S1400, selecting the target cluster configuration information corresponding to the cluster search performance data that meets the preset conditions for configuring the number of nodes required for the commodity search service, the following steps are included:
[0147] Step S1410: configuring the number of nodes required for the product search service according to the selected target cluster configuration information, so as to achieve expansion or reduction of computing resources of the product search service;
[0148] According to the number of nodes corresponding to the selected target cluster configuration information, the number of nodes in the cluster of the e-commerce service platform is configured to support the product search service. For example, the product search service is a service provided for actual application scenarios with high traffic and high concurrency. The number of nodes corresponding to the target cluster configuration information selected to support the service is to increase the number of nodes by 9. Accordingly, the number of nodes in the cluster of the e-commerce service platform is configured to increase the number of nodes by 9. The product search service is suitable for normal actual application scenarios, and the current actual scenario is high traffic and high concurrency. Therefore, the number of nodes corresponding to the target cluster configuration information selected to support the service is to reduce the number of nodes by 7. Accordingly, the number of nodes in the cluster of the e-commerce service platform is configured to reduce the number of nodes by 7. In this way, the expansion or contraction of the computing resources of the product search service is achieved, that is, the corresponding increase or decrease of cluster nodes, and the rational planning of computing resources.
[0149] Step S1420: respond to the product search request and call the product search service to obtain search results corresponding to the request;
[0150] An e-commerce service platform can be set up to provide an entrance for users to search for products and the product search service. The entrance can be a product search button, a product search input box, etc., so that when a user needs to search for a product, he can touch the entrance and enter a search keyword text into it to trigger a product search request. The e-commerce service platform obtains the search keyword text and receives the request to respond to it, calls the product search service to start the cluster, and searches the product information of the products in the product database of the e-commerce service platform stored in the cluster according to the search keyword text. The search includes precise search and fuzzy search, and the product information includes product title text and product details text, and the product corresponding to the product information matching the search keyword text is obtained as the search result corresponding to the request.
[0151] Step S1430: respond to the product search request with the search results.
[0152] In one embodiment, further, the purchase volume, positive review volume, and collection volume of the product corresponding to the search result are obtained. The purchase volume, positive review volume, and search volume of the product can be flexibly obtained by technical personnel in this field, and the corresponding weights of the purchase volume, positive review volume, and collection volume of the product are set. For example, the corresponding weights are 50%, 35%, and 15%. Technical personnel in this field can flexibly set them as needed. Accordingly, the purchase volume, positive review volume, and collection volume of the product are respectively multiplied by the corresponding weights and then added to obtain the corresponding comprehensive ranking score of the product. The corresponding products are comprehensively ranked in order of the comprehensive ranking score from high to low, and then a product search list is constructed with the comprehensively ranked products, and the product search list is pushed to the user who triggered the product search request to respond to the product search request.
[0153] In this embodiment, the number of nodes required for the commodity search service is configured according to the selected target cluster configuration information to achieve expansion or reduction of computing resources of the commodity search service.
[0154] In this embodiment, the computing resources of the commodity search service are expanded or reduced, and the computing resources are rationally planned so that the planned computing resources can satisfy the commodity search service while avoiding unnecessary waste.
[0155] See also Figure 6 A cluster configuration device provided to meet one of the purposes of the present application is a functional embodiment of the cluster configuration method of the present application, and the device includes: an initial configuration acquisition module 1100, a target configuration acquisition module 1200, a search performance evaluation module 1300, and a configuration node module 1400, wherein the initial configuration acquisition module 1100 is used to obtain initial cluster configuration information, and the cluster configuration information includes the number of nodes corresponding to the commodity search service; the target configuration acquisition module 1200 is used to obtain multiple target cluster configuration information by changing the number of nodes in the initial cluster configuration information; the search performance evaluation module 1300 is used to apply a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient; the configuration node module 1400 is used to select the target cluster configuration information corresponding to the cluster search performance data that meets the preset conditions for configuring the number of nodes required for the commodity search service.
[0156] In a further embodiment, before the search performance evaluation module 1300, there is also: a formula construction module, which is used to construct the performance evaluation formula, so that in the performance evaluation formula, the cluster search performance data corresponding to the number of nodes of the given target cluster configuration information is calculated according to the total number of index instances of the data set of the commodity search service and the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node and a preset adjustment coefficient.
[0157] In a further embodiment, the formula construction module includes: a shard deployment submodule, which is used to shard and deploy the test data set to multiple nodes with multiple index instances; a shard search performance calculation submodule, which is used to call a preset search performance function to calculate the corresponding maximum query rate per second for each shard based on the data capacity of the test data set, and the search performance function represents the mapping relationship between the data set capacity and the maximum query rate per second; a shard number calculation submodule, which is used to calculate the average number of shards for each node; a cluster search performance acquisition module, which is used to perform a commodity search service on the test data in the test data set to implement a search stress test and obtain the corresponding maximum query rate per second of the cluster; an adjustment coefficient fitting submodule, which is used to fit the adjustment coefficient based on the corresponding relationship between the corresponding maximum query rate per second of the service cluster and the comprehensive product of the average maximum query rate per second of each shard and the total number of index instances; a performance evaluation formula determination submodule, which determines the performance evaluation formula, which calculates the corresponding estimated maximum query rate per second of the cluster as the cluster search performance data by the product of the maximum query rate per second, the comprehensive product and the adjustment coefficient.
[0158] In a further embodiment, before the sharding deployment submodule, there are: a sharding deployment submodule, which is used to deploy a preset test data set into single-index instance shards to multiple nodes; a search performance acquisition submodule, which is used to perform a search stress test on the test data set to obtain the corresponding maximum query rate per second of the single-index instance shard; and a search performance function construction submodule, which is used to construct a search performance function of the single-index instance shard based on the correspondence between the data capacity of the test data and the maximum query rate per second obtained by the search stress test.
[0159] In a further embodiment, the search performance evaluation module 1300 includes: a shard deployment submodule, used to adjust the deployment of the cluster's index instances and their shards according to the number of nodes in the target cluster configuration information; a variable confirmation submodule, used to determine the total number of index instances after the adjusted deployment and the average number of shards corresponding to the unit node; a cluster search performance determination submodule, used to call a preset performance evaluation formula to determine the cluster search performance data based on the total number of index instances and the average number of shards.
[0160] In a further embodiment, after the configuration node module 1400, there are: a scaling module, which is used to configure the number of nodes required by the product search service according to the selected target cluster configuration information, so as to achieve expansion or reduction of the computing resources of the product search service; a request response module, which is used to respond to the product search request and call the product search service to obtain the search results corresponding to the request; and a request reply module, which is used to reply to the product search request with the search results.
[0161] In order to solve the above technical problems, the present application also provides a computer device. Figure 7 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a cluster configuration method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the cluster configuration method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0162] In this embodiment, the processor is used to execute Figure 6 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the cluster configuration device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0163] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the cluster configuration method of any embodiment of the present application.
[0164] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0165] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0166] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
[0167] To summarize, the present application can estimate the search performance of a cluster through a performance evaluation formula, so that the estimated search performance of a cluster does not need to pass a large number of corresponding stress tests. It can be estimated through the performance evaluation formula, which is convenient and efficient, and has forward-looking nature. It can estimate the corresponding search performance after the change before expanding or shrinking the cluster. Based on this, it can further realize the expansion or reduction of computing resources for commodity search services, and rationally plan computing resources so that the planned computing resources can both meet the needs of commodity search services and avoid unnecessary waste.
[0168] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A cluster configuration method, characterized in that: The steps include: Acquire initial cluster configuration information, where the cluster configuration information includes the number of nodes corresponding to the product search service; Based on the initial cluster configuration information, the number of nodes therein is changed to obtain multiple target cluster configuration information; Applying a preset performance evaluation formula to calculate cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient; Selecting target cluster configuration information corresponding to cluster search performance data that meets preset conditions to configure the number of nodes required for the commodity search service; Wherein: before the step of applying the preset performance evaluation formula, the method includes: The performance evaluation formula is constructed so that the cluster search performance data corresponding to the number of nodes of a given target cluster configuration information is calculated in the performance evaluation formula according to the total number of index instances of the data set of the commodity search service, the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node, and a preset adjustment coefficient.
2. The method according to claim 1, characterized in that Constructing the performance evaluation formula includes the following steps: Deploy the test dataset into multiple index instances and shard them to multiple nodes; According to the data capacity of the test data set, a preset search performance function is called to calculate the maximum query rate per second corresponding to each shard, wherein the search performance function represents the mapping relationship between the data set capacity and the maximum query rate per second; Calculate the average number of shards per node; Execute a product search service on the test data in the test data set to implement a search stress test, and obtain a corresponding maximum query rate per second of the cluster; The adjustment coefficient is fitted based on the corresponding relationship between the corresponding maximum query rate per second of the service cluster and the comprehensive product of the average maximum query rate per second of each shard and the total number of index instances; The performance evaluation formula is determined, and the performance evaluation formula calculates the estimated maximum query rate per second of the cluster as the cluster search performance data by the product of the maximum query rate per second, the comprehensive product and the adjustment coefficient.
3. The cluster configuration method according to claim 2, characterized in that: Before deploying the test dataset to multiple nodes through multi-index instance sharding, the following steps are included: The preset test data set is split into single index instances and deployed to multiple nodes; Performing a search stress test on the test data set to obtain a corresponding maximum query rate per second of the cluster; According to the corresponding relationship between the data capacity of the test data and the maximum query rate per second obtained by the search stress test, a search performance function under a single index instance is constructed.
4. The cluster configuration method according to claim 1, characterized in that: Applying a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient includes the following steps: Adjusting the deployment of the cluster's index instances and their shards according to the number of nodes in the target cluster configuration information; Determine the total number of index instances after the adjustment deployment and the average number of shards per node; A preset performance evaluation formula is called to determine cluster search performance data according to the total number of index instances and the average number of shards.
5. The cluster configuration method according to claim 1, characterized in that: After the step of selecting the target cluster configuration information corresponding to the cluster search performance data meeting the preset conditions for configuring the number of nodes required for the commodity search service, the following steps are included: Configuring the number of nodes required by the product search service according to the selected target cluster configuration information to achieve expansion or reduction of computing resources of the product search service; In response to a product search request, the product search service is called to obtain search results corresponding to the request; The product search request is responded to with the search result.
6. A cluster configuration device, characterized in that: include: An initial configuration acquisition module, used to acquire initial cluster configuration information, wherein the cluster configuration information includes the number of nodes corresponding to the commodity search service; A target configuration acquisition module is used to obtain multiple target cluster configuration information by changing the number of nodes in the initial cluster configuration information; A search performance evaluation module, used to apply a preset performance evaluation formula to calculate the cluster search performance data corresponding to each target cluster configuration information according to a preset adjustment coefficient; A node configuration module is used to select target cluster configuration information corresponding to cluster search performance data that meets preset conditions to configure the number of nodes required for the commodity search service; Wherein: before the step of applying the preset performance evaluation formula, the method includes: The performance evaluation formula is constructed so that the cluster search performance data corresponding to the number of nodes of a given target cluster configuration information is calculated in the performance evaluation formula according to the total number of index instances of the data set of the commodity search service, the maximum query rate per second of a single shard corresponding to the index instance shards stored in each node, and a preset adjustment coefficient.
7. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 5 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
