CN116489156A - Traffic distribution method and device, storage medium and electronic equipment - Google Patents

Traffic distribution method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116489156A
CN116489156A CN202310377833.9A CN202310377833A CN116489156A CN 116489156 A CN116489156 A CN 116489156A CN 202310377833 A CN202310377833 A CN 202310377833A CN 116489156 A CN116489156 A CN 116489156A
Authority
CN
China
Prior art keywords
target
cluster
rate
failure rate
agent container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310377833.9A
Other languages
Chinese (zh)
Inventor
刘成锋
王鹏培
凌晨
韩越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310377833.9A priority Critical patent/CN116489156A/en
Publication of CN116489156A publication Critical patent/CN116489156A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2483Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a flow distribution method, a flow distribution device, a storage medium and electronic equipment. Relates to the technical field of cloud computing. The method comprises the following steps: identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate of association of the target agent container, and determining health rate of the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to the service end corresponding to the candidate agent container under the condition that the failure rate or the health rate is the abnormal value. By the method and the device, the problem that the service clusters are abnormal when processing the service traffic due to the fact that the traffic pressure of each service cluster cannot be perceived in the related technology is solved.

Description

Traffic distribution method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a method and an apparatus for distributing traffic, a storage medium, and an electronic device.
Background
With the continuous development of distributed micro services, the micro service clusters are continuously expanded in size, so that service call is guaranteed to be high in availability, and a plurality of provider micro service clusters are often deployed to provide services for the outside together. In order to ensure stable service operation and maximally utilize service cluster resources, service cluster resource utilization is required by adopting a traffic load balancing mode among multiple clusters.
The current mainstream multi-cluster load balancing scheme is traffic fragmentation load based on intelligent domain names. The service areas correspond to the service clusters, the service clusters are mounted to the same intelligent domain name, after receiving a service flow, the intelligent domain name DNS equipment transfers the service flow to the service cluster corresponding to the service area by calling the end area attribute, and if no provider exists in the service cluster corresponding to the service area, the service area is loaded to other service clusters at random.
However, the intelligent domain name DNS is only a simple traffic load balancing device, and cannot sense traffic pressure of each service cluster, and under the condition of unbalanced traffic of each service fragment area, overload of individual clusters is caused to cause a large number of service call overtime failures, but service resources of other clusters are idle in a large number, so that a phenomenon of computational waste occurs, and reasonable scheduling operation among a plurality of service clusters cannot be performed.
Aiming at the problem that the service clusters are abnormal when processing the service traffic caused by the fact that the traffic pressure of each service cluster cannot be perceived in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The application provides a traffic distribution method, a traffic distribution device, a storage medium and electronic equipment, which are used for solving the problem that traffic pressure of each service cluster cannot be perceived in the related technology, so that the service cluster is abnormal when processing service traffic.
According to one aspect of the present application, a method of distributing traffic is provided. The method comprises the following steps: identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing flow business of a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate proxy container is positioned in the target cluster or in other clusters.
Optionally, when the failure rate or the health rate is an abnormal value, controlling the target gateway to send the target traffic to the server corresponding to the candidate agent container includes: under the condition that the failure rate is an abnormal value, selecting any proxy container except the target proxy container from the target cluster to obtain a candidate proxy container, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container; under the condition that the health rate is an abnormal value, determining the total flow received by the target cluster at the current moment, and determining the ratio between the total flow and the maximum processing flow of the target cluster to obtain a target ratio; and judging whether the target ratio is larger than the health rate, and sending the target flow to any proxy container in other clusters under the condition that the target ratio is larger than the health rate, wherein the other clusters are any clusters except the non-target cluster.
Optionally, determining the cluster for processing the target traffic, obtaining the target cluster includes: identifying a user side for sending the target flow to obtain a target user side; and determining the cluster associated with the target user end through a preset configuration table to obtain the target cluster, wherein the preset configuration table comprises a plurality of user ends and the cluster associated with each user end.
Optionally, determining the health rate of the target cluster includes: acquiring the current state of each server in the target cluster to obtain a plurality of current states; determining the number of the service ends with normal current states to obtain a first number; and obtaining the total number of the service ends of the target cluster, and calculating the ratio of the first number to the total number to obtain the health rate.
Optionally, determining whether the failure rate is an outlier and determining whether the health rate is an outlier includes: judging whether the failure rate is larger than a failure rate threshold value; under the condition that the failure rate is larger than the failure rate threshold value, determining that the failure rate is an abnormal value; judging whether the health rate is greater than a health rate threshold; in the case where the health rate is less than the health rate threshold, the health rate is determined to be an outlier.
Optionally, after determining whether the failure rate is an outlier, the method further comprises: under the condition that the failure rate is an abnormal value, acquiring a maximum flow processing value of the target agent container, wherein the maximum flow processing value represents the maximum flow value which can be processed in parallel by the target agent container; judging whether the maximum flow processing value is smaller than a preset flow processing value or not; under the condition that the maximum flow processing value is smaller than or equal to the preset flow processing value, changing the current state of the target agent container into an abnormal state, and initializing the failure rate of the target agent container; and under the condition that the maximum flow processing value is larger than the preset flow processing value, reducing the maximum flow processing value of the target agent container.
Optionally, determining the failure rate of the target agent container association includes: acquiring a historical flow processing log of a target agent container, and acquiring a historical processing result from the historical flow processing log, wherein the maximum flow processing value of the target agent container in the historical flow processing log is the same as the maximum flow processing value of the target agent container at the current moment; and acquiring the total processing number and the failure processing number in the historical processing result, and calculating the proportion of the failure processing number in the total processing number to obtain the failure rate.
According to another aspect of the present application, a flow distribution device is provided. The device comprises: the identifying unit is used for identifying the target traffic flowing through the target gateway, determining a cluster for processing the target traffic and obtaining a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end; the system comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for selecting any agent container from a target cluster to obtain a target agent container, determining the failure rate associated with the target agent container and determining the health rate of the target cluster, wherein the failure rate is the failure rate of a server monitored by the target agent container for processing traffic, and the health rate is determined by the running states of a plurality of servers in the target cluster; the control unit is used for judging whether the failure rate is an abnormal value or not and judging whether the health rate is an abnormal value or not, and under the condition that the failure rate or the health rate is the abnormal value, the control target gateway sends the target flow to the server corresponding to the candidate agent container, wherein the candidate agent container is located in the target cluster or the rest clusters.
According to another aspect of the present invention, there is also provided a computer storage medium for storing a program, wherein the program when run controls a device in which the computer storage medium is located to perform a method of allocating traffic.
According to another aspect of the present invention, there is also provided an electronic device comprising one or more processors and a memory; the memory has stored therein computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions execute a method of allocating traffic.
Through the application, the following steps are adopted: identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing flow business of a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate proxy container is positioned in the target cluster or in other clusters. The method solves the problem that the service clusters are abnormal when processing the service traffic caused by the fact that the traffic pressure of each service cluster cannot be perceived in the related art. By associating one proxy container with each server, monitoring the failure rate and the health rate of the server in real time through the proxy containers, and adjusting the target clusters and the flow distribution modes of the servers in the target clusters by the controller according to the failure rates and the health rates detected by the proxy containers, the effects of sensing the flow pressure of each service cluster in real time and adjusting the flow distribution modes according to the flow pressure conditions are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a schematic diagram of a flow distribution system provided in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of a method of flow distribution provided in accordance with an embodiment of the present application;
FIG. 3 is a schematic illustration of a flow distribution device provided in accordance with an embodiment of the present application;
fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
It should be noted that the method, the device, the storage medium and the electronic device for distributing the flow determined in the present disclosure may be used in the field of cloud computing technology, and may also be used in any field other than the field of cloud computing technology, and the application fields of the method, the device, the storage medium and the electronic device for distributing the flow determined in the present disclosure are not limited.
Fig. 1 is a schematic diagram of a flow distribution system according to an embodiment of the present application, in this embodiment, as shown in fig. 1, an optional flow distribution system is used as an execution body to execute the foregoing flow distribution method, where the flow distribution system at least includes:
the service end, namely the service provider, is located in the node and connected with the container, is the minimum unit for processing the service flow, and is used for processing the service content transmitted by the flow sent by the user end.
The proxy container is connected with the server in a one-to-one correspondence manner and is used for monitoring the running condition of the server and the traffic service processing condition.
And (3) node: each node is composed of a server and a proxy container, so that the management of the server in the cluster is facilitated.
The user end, namely the service consumer is connected with the gateway, and the user can send the service flow to the service end through the service end.
And the controller is connected with the proxy container and the gateway, and is used for acquiring the monitoring data in the corresponding service end acquired by each proxy container, and controlling the gateway according to the monitoring data, so that the gateway can adjust the flow distribution according to the monitoring result.
The gateway is connected with the controller, the container and the user side, and the user side invokes the server side by crossing the cluster gateway and reasonably distributes the flow according to the instruction sent by the controller.
Specifically, the gateway receives the service traffic sent by the user side 1 and the user side 2, at this time, the service traffic needs to be distributed, when the cluster corresponding to the user side 1 is the cluster a and the cluster corresponding to the user side 2 is the cluster B, the service traffic 1 can be sent to the node 1 or the node 2, and the service traffic 2 can be sent to any node in the cluster B, for example, the node n, at this time, whether the node can process the service traffic needs to be determined by the failure rate of the service side returned by the container, and at the moment, the service traffic 2 cannot be processed in the service side n in the node n and needs to be sent to other containers, so that the service side of each cluster can successfully complete the processing of each service traffic in the current state is ensured.
According to an embodiment of the application, a method for distributing traffic is provided. Fig. 2 is a flowchart of a flow distribution method provided according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
step S201, identifying a target traffic flowing through the target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, where the target cluster includes a plurality of servers and a proxy container of each server.
Specifically, the target gateway may be connected to the controller, the container and the user side, where the user side invokes the server side by crossing the cluster gateway, and reasonably distributes the traffic according to the instruction sent by the controller, where the target traffic may be the traffic generated by the user side when the user side handles a service, and after the target gateway receives the target traffic, the target gateway needs to identify the cluster for processing the target traffic, so as to determine the target cluster.
It should be noted that, as shown in fig. 1, there are multiple nodes in the target cluster, each node is composed of a server and a proxy container, and the proxy container corresponds to the server one by one, and is used for monitoring the server, so as to determine a processing result of the server when processing each flow.
Step S202, selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing traffic by a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster.
Specifically, after the target cluster is determined, any proxy container can be selected from the target cluster to obtain a target proxy container, and the failure rate associated with the target proxy container is determined, that is, the failure rate is the failure rate of the processing flow of the server, which is calculated according to the processing result of the processing service flow of the server after the target container monitors the corresponding server.
It should be noted that the failure rate may be a failure rate of the service corresponding to the processing flow of the service end associated with the target container, for example, the failure rate is 33% when the service end a receives the service flow 3 times and completes the service 2 times successfully and completes the service 1 time failed.
Further, the health rate characterizes the traffic processing capacity of the cluster, after determining the failure rate of the target agent container, the health rate of the target cluster needs to be determined, so as to determine whether the target cluster can receive and process the target traffic, and when determining the health rate of the target cluster, not only the monitoring information of the target agent container, but also the monitoring information of the rest agent containers in the target cluster is needed, so that the health rate of the target cluster can be calculated according to the monitoring information of each agent container in the target cluster, and thus the traffic processing capacity of the target cluster is determined.
Step S203, judging whether the failure rate is an abnormal value, judging whether the health rate is an abnormal value, and controlling the target gateway to send the target flow to the server corresponding to the candidate agent container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate agent container is located in the target cluster or the rest clusters.
Specifically, in the case that any one of the failure rate and the health rate is abnormal, where the health rate is too low or the failure rate is too high, at this time, the token cannot send the target traffic to the target proxy container, at this time, the target gateway cannot send the target traffic to the target proxy container according to a preset traffic allocation rule, and instead, the target gateway needs to be controlled to send the target traffic to other proxy containers, where selection of the other proxy containers needs to be determined according to the failure rate and the health rate, that is, whether the candidate proxy container is selected in the target cluster or the candidate proxy container is selected in the other cluster is determined according to the abnormal conditions of the failure rate and the health rate.
According to the traffic distribution method, the target traffic flowing through the target gateway is identified, and the cluster for processing the target traffic is determined to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and agent containers of the service ends; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing flow business of a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate proxy container is positioned in the target cluster or in other clusters. The method solves the problem that the service clusters are abnormal when processing the service traffic caused by the fact that the traffic pressure of each service cluster cannot be perceived in the related art. By associating one proxy container with each server, monitoring the failure rate and the health rate of the server in real time through the proxy containers, and adjusting the target clusters and the flow distribution modes of the servers in the target clusters by the controller according to the failure rates and the health rates detected by the proxy containers, the effects of sensing the flow pressure of each service cluster in real time and adjusting the flow distribution modes according to the flow pressure conditions are achieved.
In order to reasonably distribute the target traffic under the condition that the target container or the target cluster is abnormal, optionally, in the traffic distribution method provided by the embodiment of the present application, under the condition that the failure rate or the health rate is an abnormal value, controlling the target gateway to send the target traffic to the server corresponding to the candidate proxy container includes: under the condition that the failure rate is an abnormal value, selecting any proxy container except the target proxy container from the target cluster to obtain a candidate proxy container, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container; under the condition that the health rate is an abnormal value, determining the total flow received by the target cluster at the current moment, and determining the ratio between the total flow and the maximum processing flow of the target cluster to obtain a target ratio; and judging whether the target ratio is larger than the health rate, and sending the target flow to any proxy container in other clusters under the condition that the target ratio is larger than the health rate, wherein the other clusters are any clusters except the non-target cluster.
Specifically, when the failure rate is an abnormal value but the health rate is normal, the processing failure rate of the service flow processed by the target proxy container is too high, and at this time, the target container cannot process the service flow normally, so that the target flow can be sent to other proxy containers in the target cluster to be judged again until a certain proxy container can process the target flow.
Further, under the condition that the health rate of the target cluster is an abnormal value, representing that a part of proxy containers which cannot normally operate exist in the target cluster, determining total flow of the flow which is simultaneously transmitted to the target cluster with the target flow, dividing the total flow by the maximum processing flow of the target cluster, obtaining the proportion of the total flow which needs to be processed currently to the maximum processing flow of the target cluster, and comparing the proportion with the health value of the target cluster, so as to determine whether the target cluster can process all the flow. Under the condition that the target ratio is larger than the health rate, the target cluster is characterized in that the target cluster cannot process all the traffic, and at the moment, the traffic needs to be split, namely, the target traffic can be sent to other clusters for processing, so that the target cluster is ensured to receive reasonable traffic, and the target cluster is ensured to normally process the received traffic.
For example, when the total traffic throughput of the cluster a is 500 and the traffic of a certain batch is 100, the proportion is 20%, and when the health value is 60%, the cluster a can complete the processing of the traffic of the batch, no diversion is needed, and when the traffic of a certain batch is 450, the proportion is 90%, and the cluster a cannot process all the traffic of the batch, so that it is necessary to distribute part of the traffic to other clusters for processing, that is, 60% of the traffic is processed by the target cluster and the remaining 30% is processed by the remaining clusters.
Optionally, in the traffic distribution method provided in the embodiment of the present application, determining a cluster for processing a target traffic, and obtaining the target cluster includes: identifying a user side for sending the target flow to obtain a target user side; and determining the cluster associated with the target user end through a preset configuration table to obtain the target cluster, wherein the preset configuration table comprises a plurality of user ends and the cluster associated with each user end.
Specifically, when determining the target cluster corresponding to the target traffic, determining the target cluster corresponding to the target traffic by determining the user side information of the target traffic and determining the name of the cluster corresponding to the user side in a preset configuration table according to the user side information.
In order to accurately calculate the health rate of the cluster, so as to determine whether the target cluster is abnormal, optionally, in the traffic distribution method provided in the embodiment of the present application, determining the health rate of the target cluster includes: acquiring the current state of each server in the target cluster to obtain a plurality of current states; determining the number of the service ends with normal current states to obtain a first number; and obtaining the total number of the service ends of the target cluster, and calculating the ratio of the first number to the total number to obtain the health rate.
Specifically, the health rate of the cluster is used for representing the proportion of the service ends which can be normally used in the cluster, so that when the health rate is calculated, the state of each service end in the cluster needs to be determined according to the proxy container, the number of the service ends with normal states is determined, and the number of the service ends with normal states is divided from the total number of the service ends in the cluster, so that the health rate can be obtained.
For example, there are 10 servers in the cluster B, where the states of 6 servers are normal, and the states of 4 servers are abnormal, and the health rate of the cluster B is 60%.
Optionally, in the flow distribution method provided in the embodiment of the present application, determining whether the failure rate is an abnormal value, and determining whether the health rate is an abnormal value includes: judging whether the failure rate is larger than a failure rate threshold value; under the condition that the failure rate is larger than the failure rate threshold value, determining that the failure rate is an abnormal value; judging whether the health rate is greater than a health rate threshold; in the case where the health rate is less than the health rate threshold, the health rate is determined to be an outlier.
Specifically, when determining whether the failure rate and the health rate are abnormal, whether the failure rate is greater than a failure rate threshold value or not and whether the health rate is greater than a health rate threshold value or not can be determined, and under the condition that the failure rate is greater than the failure rate threshold value, the service end is characterized by more failure times when the service end processes the service traffic, so that the service end corresponding to the target agent container is determined to be unable to continuously process the service traffic, and the failure rate associated with the target agent container is determined to be an abnormal value.
Similarly, in the case that the health rate is smaller than the health rate threshold, the number of servers that can be normally used in the characterization target cluster is smaller, and at this time, the health rate of the target cluster can be determined to be an abnormal value.
Optionally, in the flow distribution method provided in the embodiment of the present application, after determining whether the failure rate is an abnormal value, the method further includes: under the condition that the failure rate is an abnormal value, acquiring a maximum flow processing value of the target agent container, wherein the maximum flow processing value represents the maximum flow value which can be processed in parallel by the target agent container; judging whether the maximum flow processing value is smaller than a preset flow processing value or not; under the condition that the maximum flow processing value is smaller than or equal to the preset flow processing value, changing the current state of the target agent container into an abnormal state, and initializing the failure rate of the target agent container; and under the condition that the maximum flow processing value is larger than the preset flow processing value, reducing the maximum flow processing value of the target agent container.
Specifically, in the case that the failure rate of the target proxy container is determined to be an abnormal value, the proxy container needs to be downgraded, that is, the maximum traffic value that the target proxy container can handle, that is, the maximum traffic processing value is reduced. After the maximum flow processing value is reduced, the failure rate of the target agent container needs to be recalculated, that is, the target agent container can still normally receive the flow and process the flow, but the flow value which can be processed by the target container is reduced, so that the effect of adjusting the container load balance according to the container state is achieved.
Further, when the maximum flow processing value is smaller than the preset flow processing value, the maximum flow processing value cannot be degraded, and at this time, the target agent container needs to be determined as an abnormal agent container, and the current state of the target agent container is changed to be abnormal, and at this time, the health rate of the target cluster to which the target agent container belongs is reduced due to the change of the state of the target agent container.
Optionally, in the traffic distribution method provided in the embodiment of the present application, determining a failure rate of association of the target agent container includes: acquiring a historical flow processing log of a target agent container, and acquiring a historical processing result from the historical flow processing log, wherein the maximum flow processing value of the target agent container in the historical flow processing log is the same as the maximum flow processing value of the target agent container at the current moment; and acquiring the total processing number and the failure processing number in the historical processing result, and calculating the proportion of the failure processing number in the total processing number to obtain the failure rate.
Specifically, when calculating the failure rate of the target agent container at the current time, it is first required to obtain the maximum flow processing value of the target agent container at the current time and obtain the history processing result from the history flow processing log, where the maximum flow processing value of the target agent container at the time of generating the history processing result is the same as the maximum flow processing value of the target agent container at the current time, for example, when the maximum flow processing value of the target agent container at the current time is 20, the maximum flow processing value of the target agent container at the time of generating the history processing result is 20, and the history processing results at other maximum flow processing values do not participate in the failure rate calculation.
Further, after the historical processing result is obtained, the result is required to be obtained as the number of failed results, and the number of failed results is divided from the total number of the historical processing results, so that the failure rate of the server associated with the target agent capacity at the current moment is obtained, and the effect of accurately calculating the failure rate of the server corresponding to the target agent container is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a flow distribution device, and the flow distribution device of the embodiment of the application can be used for executing the flow distribution method provided by the embodiment of the application. The flow distribution device provided in the embodiment of the present application is described below.
Fig. 3 is a schematic view of a flow distribution device provided according to an embodiment of the present application. As shown in fig. 3, the apparatus includes: the identification unit 31, the determination unit 32, the control unit 33.
The identifying unit 31 is configured to identify a target traffic flowing through the target gateway, and determine a cluster for processing the target traffic, so as to obtain a target cluster, where the target cluster includes a plurality of servers and a proxy container of each server.
The determining unit 32 is configured to select an arbitrary proxy container from the target cluster, obtain the target proxy container, determine a failure rate associated with the target proxy container, and determine a health rate of the target cluster, where the failure rate is a failure rate of the server monitored by the target proxy container to process the traffic service, and the health rate is determined by operation states of multiple servers in the target cluster.
And the control unit 33 is configured to determine whether the failure rate is an abnormal value, and determine whether the health rate is an abnormal value, and if the failure rate or the health rate is an abnormal value, control the target gateway to send the target traffic to the server corresponding to the candidate agent container, where the candidate agent container is located in the target cluster or located in the other clusters.
According to the traffic distribution device provided by the embodiment of the application, the target traffic flowing through the target gateway is identified through the identification unit 31, and the cluster for processing the target traffic is determined to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and agent containers of each service end; the determining unit 32 selects any agent container in the target cluster to obtain a target agent container, determines failure rate associated with the target agent container, and determines health rate of the target cluster, wherein the failure rate is failure rate of processing traffic by a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; the control unit 33 determines whether the failure rate is an abnormal value, and determines whether the health rate is an abnormal value, and if the failure rate or the health rate is an abnormal value, controls the target gateway to send the target traffic to the server corresponding to the candidate agent container, where the candidate agent container is located in the target cluster or in the remaining clusters. The method solves the problem that the service clusters are abnormal when processing the service traffic caused by the fact that the traffic pressure of each service cluster cannot be perceived in the related art. By associating one proxy container with each server, monitoring the failure rate and the health rate of the server in real time through the proxy containers, and adjusting the target clusters and the flow distribution modes of the servers in the target clusters by the controller according to the failure rates and the health rates detected by the proxy containers, the effects of sensing the flow pressure of each service cluster in real time and adjusting the flow distribution modes according to the flow pressure conditions are achieved.
Optionally, in the flow distribution device provided in the embodiment of the present application, the control unit 33 includes: the control module is used for selecting any proxy container except the target proxy container from the target cluster under the condition that the failure rate is an abnormal value, obtaining a candidate proxy container, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container; the first determining module is used for determining the total flow received by the target cluster at the current moment under the condition that the health rate is an abnormal value, and determining the ratio between the total flow and the maximum processing flow of the target cluster to obtain a target ratio; the first judging module is used for judging whether the target ratio is larger than the health rate or not, and sending the target flow to any proxy container in other clusters under the condition that the target ratio is larger than the health rate, wherein the other clusters are any clusters except the non-target cluster.
Optionally, in the flow distribution device provided in the embodiment of the present application, the identifying unit 31 includes: the identification module is used for identifying the user terminal for sending the target flow to obtain a target user terminal; the second determining module is configured to determine a cluster associated with the target user terminal through a preset configuration table, so as to obtain the target cluster, where the preset configuration table includes a plurality of user terminals and clusters associated with each user terminal.
Optionally, in the flow distribution device provided in the embodiment of the present application, the determining unit 32 includes: the first acquisition module is used for acquiring the current state of each server in the target cluster to obtain a plurality of current states; the third determining module is used for determining the number of the service ends with normal current states to obtain a first number; the second acquisition module is used for acquiring the total number of the servers of the target cluster, and calculating the ratio of the first number to the total number to obtain the health rate.
Optionally, in the flow distribution device provided in the embodiment of the present application, the control unit 33 includes: the second judging module is used for judging whether the failure rate is larger than a failure rate threshold value or not; a fourth determining module, configured to determine that the failure rate is an outlier when the failure rate is greater than the failure rate threshold; the third judging module is used for judging whether the health rate is larger than a health rate threshold value or not; and a fifth determining module, configured to determine that the health rate is an outlier if the health rate is less than the health rate threshold.
Optionally, in the flow distribution device provided in the embodiment of the present application, the device further includes: the acquisition unit is used for acquiring the maximum flow processing value of the target agent container under the condition that the failure rate is an abnormal value, wherein the maximum flow processing value represents the maximum flow value which can be processed in parallel by the target agent container; the judging unit is used for judging whether the maximum flow processing value is smaller than a preset flow processing value or not; a changing unit, configured to change the current state of the target agent container to be abnormal and initialize the failure rate of the target agent container when the maximum flow processing value is less than or equal to the preset flow processing value; and the reduction unit is used for reducing the maximum flow processing value of the target agent container under the condition that the maximum flow processing value is larger than the preset flow processing value.
Optionally, in the flow distribution device provided in the embodiment of the present application, the determining unit 32 includes: the third acquisition module is used for acquiring a historical flow processing log of the target agent container and acquiring a historical processing result from the historical flow processing log, wherein the maximum flow processing value of the target agent container in the historical flow processing log is the same as the maximum flow processing value of the target agent container at the current moment; and the fourth acquisition module is used for acquiring the total processing quantity and the failure processing quantity in the historical processing result, and calculating the proportion of the failure processing quantity in the total processing quantity to obtain the failure rate.
The flow distribution device includes a processor and a memory, and the identification unit 31, the determination unit 32, the control unit 33, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the problem that the service clusters are abnormal when processing the service traffic caused by the fact that the traffic pressure of each service cluster cannot be perceived in the related technology is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium having stored thereon a program that, when executed by a processor, implements a method of allocating traffic.
The embodiment of the invention provides a processor which is used for running a program, wherein the program runs to execute the flow distribution method.
As shown in fig. 4, an embodiment of the present invention provides an electronic device, where the electronic device 40 includes a processor, a memory, and a program stored on the memory and executable on the processor, and when the processor executes the program, the following steps are implemented: identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing flow business of a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate proxy container is positioned in the target cluster or in other clusters. The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end; selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing flow business of a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster; judging whether the failure rate is an abnormal value or not, judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate proxy container is positioned in the target cluster or in other clusters.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A method of distributing traffic, comprising:
identifying target traffic flowing through a target gateway, and determining a cluster for processing the target traffic to obtain a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end;
Selecting any agent container from the target cluster to obtain a target agent container, determining failure rate associated with the target agent container, and determining health rate of the target cluster, wherein the failure rate is failure rate of processing traffic service by a server monitored by the target agent container, and the health rate is determined by running states of a plurality of servers in the target cluster;
and judging whether the failure rate is an abnormal value or not, and judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a server corresponding to a candidate agent container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate agent container is positioned in the target cluster or in other clusters.
2. The method of claim 1, wherein controlling the target gateway to send the target traffic to the server corresponding to the candidate proxy container if the failure rate or the health rate is an outlier comprises:
under the condition that the failure rate is an abnormal value, selecting any proxy container except the target proxy container from the target cluster to obtain the candidate proxy container, and controlling the target gateway to send the target flow to a server corresponding to the candidate proxy container;
Under the condition that the health rate is an abnormal value, determining the total flow received by the target cluster at the current moment, and determining the ratio between the total flow and the maximum processing flow of the target cluster to obtain a target ratio;
and judging whether the target ratio is larger than the health rate, and sending the target flow to any proxy container in other clusters under the condition that the target ratio is larger than the health rate, wherein the other clusters are any clusters except the non-target cluster.
3. The method of claim 1, wherein determining a cluster for processing the target traffic, the target cluster comprising:
identifying a user terminal for transmitting the target flow to obtain a target user terminal;
and determining the cluster associated with the target user terminal through a preset configuration table to obtain the target cluster, wherein the preset configuration table comprises a plurality of user terminals and the cluster associated with each user terminal.
4. The method of claim 1, wherein determining the health rate of the target cluster comprises:
acquiring the current state of each server in the target cluster to obtain a plurality of current states;
Determining the number of the service ends with normal current states to obtain a first number;
and obtaining the total number of the service ends of the target cluster, and calculating the ratio of the first number to the total number to obtain the health rate.
5. The method of claim 1, wherein determining whether the failure rate is an outlier and determining whether the health rate is an outlier comprises:
judging whether the failure rate is larger than a failure rate threshold value or not;
determining that the failure rate is an outlier if the failure rate is greater than the failure rate threshold;
judging whether the health rate is larger than a health rate threshold value or not;
and determining that the health rate is an outlier if the health rate is less than the health rate threshold.
6. The method of claim 1, wherein after determining whether the failure rate is an outlier, the method further comprises:
obtaining a maximum flow processing value of the target agent container under the condition that the failure rate is an abnormal value, wherein the maximum flow processing value represents a maximum flow value which can be processed in parallel by the target agent container;
judging whether the maximum flow processing value is smaller than a preset flow processing value or not;
Changing the current state of the target agent container to be abnormal and initializing the failure rate of the target agent container under the condition that the maximum flow processing value is smaller than or equal to the preset flow processing value;
and reducing the maximum flow processing value of the target agent container under the condition that the maximum flow processing value is larger than the preset flow processing value.
7. The method of claim 6, wherein determining the failure rate of the target agent container association comprises:
acquiring a historical flow processing log of the target agent container, and acquiring a historical processing result from the historical flow processing log, wherein the maximum flow processing value of the target agent container in the historical flow processing log is the same as the maximum flow processing value of the target agent container at the current moment;
and obtaining the total processing quantity and the failure processing quantity in the historical processing result, and calculating the proportion of the failure processing quantity in the total processing quantity to obtain the failure rate.
8. A flow distribution device comprising:
the identifying unit is used for identifying the target traffic flowing through the target gateway, determining a cluster for processing the target traffic and obtaining a target cluster, wherein the target cluster comprises a plurality of service ends and a proxy container of each service end;
The determining unit is used for selecting any agent container from the target cluster to obtain a target agent container, determining the failure rate associated with the target agent container and determining the health rate of the target cluster, wherein the failure rate is the failure rate of the service end monitored by the target agent container to process the traffic service, and the health rate is determined by the running states of a plurality of service ends in the target cluster;
and the control unit is used for judging whether the failure rate is an abnormal value or not and judging whether the health rate is an abnormal value or not, and controlling the target gateway to send the target flow to a service end corresponding to a candidate agent container under the condition that the failure rate or the health rate is the abnormal value, wherein the candidate agent container is positioned in the target cluster or in other clusters.
9. A computer storage medium for storing a program, wherein the program when run controls a device in which the computer storage medium is located to perform the method of allocating traffic according to any one of claims 1 to 7.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of allocating traffic of any of claims 1-7.
CN202310377833.9A 2023-04-10 2023-04-10 Traffic distribution method and device, storage medium and electronic equipment Pending CN116489156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310377833.9A CN116489156A (en) 2023-04-10 2023-04-10 Traffic distribution method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310377833.9A CN116489156A (en) 2023-04-10 2023-04-10 Traffic distribution method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116489156A true CN116489156A (en) 2023-07-25

Family

ID=87220608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310377833.9A Pending CN116489156A (en) 2023-04-10 2023-04-10 Traffic distribution method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116489156A (en)

Similar Documents

Publication Publication Date Title
CN109218355B (en) Load balancing engine, client, distributed computing system and load balancing method
CN110858161B (en) Resource allocation method, device, system, equipment and medium
CN111818159B (en) Management method, device, equipment and storage medium of data processing node
US20120173709A1 (en) Seamless scaling of enterprise applications
US9923785B1 (en) Resource scaling in computing infrastructure
US10069757B1 (en) Reserved network device capacity
US20140089510A1 (en) Joint allocation of cloud and network resources in a distributed cloud system
CN107105013B (en) File processing method, server, terminal and system
CN106936867B (en) Service request response method and device
US20240073298A1 (en) Intelligent scheduling apparatus and method
EP3021521A1 (en) A method and system for scaling, telecommunications network and computer program product
CN112698952A (en) Unified management method and device for computing resources, computer equipment and storage medium
CN109218441A (en) A kind of P2P network dynamic load balancing method based on prediction and region division
CN111338750A (en) Pressure adjusting method and device for execution node, server and storage medium
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
CN110290210B (en) Method and device for automatically allocating different interface flow proportions in interface calling system
CN116489156A (en) Traffic distribution method and device, storage medium and electronic equipment
CN111522664A (en) Service resource management and control method and device based on distributed service
CN115776510A (en) Control method and device of heartbeat packet, processor and electronic equipment
KR20130114697A (en) Seamless scaling of enterprise applications
Souidi et al. An adaptive real time mechanism for IaaS cloud provider selection based on QoE aspects
CN108307206A (en) A kind of distribution method and device of live streaming encoding tasks
CN116627653A (en) Service request processing method and device, storage medium and electronic equipment
CN116566918A (en) Traffic distribution method and device, storage medium and electronic equipment
CN112261076B (en) Download service separation method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination