CN110049084A - Current-limiting method, device and the equipment of distributed system - Google Patents

Current-limiting method, device and the equipment of distributed system Download PDF

Info

Publication number
CN110049084A
CN110049084A CN201811505451.5A CN201811505451A CN110049084A CN 110049084 A CN110049084 A CN 110049084A CN 201811505451 A CN201811505451 A CN 201811505451A CN 110049084 A CN110049084 A CN 110049084A
Authority
CN
China
Prior art keywords
request
processed
node
host node
current
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.)
Granted
Application number
CN201811505451.5A
Other languages
Chinese (zh)
Other versions
CN110049084B (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811505451.5A priority Critical patent/CN110049084B/en
Publication of CN110049084A publication Critical patent/CN110049084A/en
Application granted granted Critical
Publication of CN110049084B publication Critical patent/CN110049084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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

Abstract

This specification provides the current-limiting method, device and equipment of a kind of distributed system, the described method includes: the current limliting scheme of distributed system can be when needing current limliting, each node intercepts the request to be processed of load balancer distribution into Message Processing queue, by host node after the request to be processed that setting quantity is chosen in the Message Processing queue, the request to be processed of selection is distributed at least one described node and is handled.The present embodiment can control the flow of whole system from the angle of global traffic, and in the case where saving system resource, can protect system still normally can externally provide service in the case where big flow impact, to achieve the purpose that protection system.

Description

Current-limiting method, device and the equipment of distributed system
Technical field
This specification is related to the current-limiting method of distributed system technical field more particularly to distributed system, device and sets It is standby.
Background technique
With the development of internet technology, operation system is not faced with the impact of big flow all the time, is especially promoting When pin activity, the flow of operation system but will reach unprecedented peak value.In order to guarantee system in face of big flow impact When external offer service still can be provided, operation system can be split into distributed system, delayed to a certain extent Solve this problem.However, the peak value of flow may be tens times of usually peak flow still for some particular times, How to guarantee that the normal operation of system becomes technical problem urgently to be resolved.
Summary of the invention
To overcome the problems in correlation technique, present description provides the current-limiting method of distributed system, device and Equipment.
According to this specification embodiment in a first aspect, provide a kind of current-limiting method of distributed system, the distribution Include multiple nodes in system, includes at least one host node and at least one child node, the current limliting in the multiple node Method includes:
After each node determines that current limliting is triggered, the request to be processed that load balancer is sent is intercepted to message It manages in queue;
The host node is after the request to be processed that setting quantity is chosen in the Message Processing queue, by the to be processed of selection Request is distributed at least one described node;
After the child node receives the request to be processed of the host node distribution, request processing flow is executed.
Optionally, the host node chooses the request to be processed from the Message Processing queue according to the setting period.
Optionally, the host node is elected to obtain by all nodes by election mechanism.
Optionally, the determining current limliting is triggered, comprising: and the quantity of request to be processed reaches setting current limit threshold, or It is to receive setting current limliting instruction.
Optionally, the method also includes the request to be processed backups that: each node also sends load balancer In database.
Optionally, the method also includes: for processing complete request to be processed, update the request in the database Processing status.
Optionally, the method also includes: if the Message Processing queue is operating abnormally, the host node is from the data Request to be processed is chosen in library.
Optionally, the host node is to choose setting the to be processed of quantity from the Message Processing queue according to priority to ask It asks.
According to the second aspect of this specification embodiment, a kind of current-limiting method of distributed system is provided, the method is answered For any node in distributed system, which comprises
After determining that current limliting is triggered, the request to be processed that load balancer is distributed is intercepted into Message Processing queue;
Determine it itself is host node either child node;
If host node, after the request to be processed that setting quantity is chosen in the Message Processing queue, by selection wait locate Reason request is distributed at least one described node;
If child node, then after the request for receiving host node distribution, request processing flow is executed.
Optionally, the host node chooses the request to be processed from the Message Processing queue according to the setting period.
Optionally, the host node is elected to obtain by all nodes by election mechanism.
Optionally, the determining current limliting is triggered, comprising: and the quantity of request to be processed reaches setting current limit threshold, or It is to receive setting current limliting instruction.
Optionally, the method also includes: by load balancer send request to be processed back up in database.
Optionally, the method also includes: for processing complete request to be processed, update the request in the database Processing status.
Optionally, the method also includes: if the Message Processing queue is operating abnormally, the host node is from the data Request to be processed is chosen in library.
Optionally, the host node is to choose setting the to be processed of quantity from the Message Processing queue according to priority to ask It asks.
According to the third aspect of this specification embodiment, a kind of current-limiting apparatus of distributed system is provided, described device is answered For any node in distributed system, described device includes:
Blocking module is used for: after determining that current limliting is triggered, the request to be processed that load balancer is distributed being intercepted to message It handles in queue;
Determining module is used for: determining it itself is host node either child node;
Distribution module is used for: if host node, the request to be processed of setting quantity is chosen from the Message Processing queue Afterwards, the request to be processed of selection is distributed at least one described node;
Processing module is used for: if child node, then after the request for receiving host node distribution, executing request processing flow.
Optionally, the host node chooses the request to be processed from the Message Processing queue according to the setting period.
Optionally, the host node is elected to obtain by all nodes by election mechanism.
Optionally, the blocking module, is also used to: the quantity of request to be processed reaches setting current limit threshold, or connects Receive setting current limliting instruction.
Optionally, described device further includes backup module, is used for: by load balancer send request to be processed backup in In database.
Optionally, the method also includes: for processing complete request to be processed, update the request in the database Processing status.
Optionally, the distribution module is also used to: if the Message Processing queue is operating abnormally, the host node is from described Request to be processed is chosen in database.
Optionally, the host node is to choose setting the to be processed of quantity from the Message Processing queue according to priority to ask It asks.
According to the fourth aspect of this specification embodiment, a kind of computer equipment is provided, including memory, processor and deposit Store up the computer program that can be run on a memory and on a processor, wherein the processor is realized when executing described program Aforementioned current-limiting method.
The technical solution that the embodiment of this specification provides can include the following benefits:
In this specification embodiment, the current limliting scheme of distributed system can be when needing current limliting, and each node intercepts negative The request to be processed of balanced device distribution is carried into Message Processing queue, chooses setting number from the Message Processing queue by host node After the request to be processed of amount, the request to be processed of selection is distributed at least one described node and is handled.The present embodiment can To control the flow of whole system from the angle of global traffic, in the case where saving system resource, it can protect system and exist Big flow still normally can externally provide service in the case where impacting, to achieve the purpose that protection system.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not This specification can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the reality for meeting this specification Example is applied, and is used to explain the principle of this specification together with specification.
Fig. 1 is a kind of this specification business scenario schematic diagram shown according to an exemplary embodiment.
Fig. 2A is a kind of this specification current-limiting method flow chart of distributed system shown according to an exemplary embodiment.
Fig. 2 B is a kind of this specification current-limiting method flow chart of distributed system shown according to an exemplary embodiment.
Fig. 2 C is a kind of this specification current-limiting method flow chart of distributed system shown according to an exemplary embodiment.
Fig. 2 D is a kind of this specification current-limiting method flow chart of distributed system shown according to an exemplary embodiment.
Fig. 3 is a kind of this specification current-limiting method flow chart of distributed system shown according to an exemplary embodiment.
Computer where Fig. 4 is the current-limiting apparatus of this specification distributed system shown according to an exemplary embodiment is set A kind of standby hardware structure diagram.
Fig. 5 is a kind of this specification block diagram of the current-limiting apparatus of distributed system shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is only to be not intended to be limiting this explanation merely for for the purpose of describing particular embodiments in the term that this specification uses Book.The "an" of used singular, " described " and "the" are also intended to packet in this specification and in the appended claims Most forms are included, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein is Refer to and includes that one or more associated any or all of project listed may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but These information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not taking off In the case where this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... " or " in response to determination ".
With the fast development of internet, Internet application is while amount of access rapid growth, operation system without when without The impact for not being faced with big flow is carved, if service still normally cannot can externally be provided under big flow impact, entirely System is likely to paralyse in the case where big flow is impacted, although operation system can split dilatation by distribution, sometimes The flow of operation system is not that can all face very big flow always, and big flow is possible to only occur in the advertising campaign phase Between, if specifically for System Expansion should be carried out to short-term big flow, within a very long time later, distributed system There is substantial portion of resource to be at idle state in fact, and then wastes system resource.
This specification embodiment is directed to above-mentioned distributed system scene, provides a kind of current limliting scheme, can be from global flow The angle of amount can protect system and impact in big flow to control the flow of whole system in the case where saving system resource In the case where service still normally can be externally provided, to achieve the purpose that protection system.
As shown in Figure 1, being a kind of this specification business scenario schematic diagram shown according to an exemplary embodiment, in Fig. 1 Include: multiple request originators, the distributed system including multiple nodes and load balancer;Wherein, load balancer with Each node connection in distributed system, load balancer can accept the request to be processed that each request originator is initiated, By the node to be processed requested assignment in distributed system.
When facing big flow, there are many number of requests that load balancer distributes to each node, it is possible to exceed node institute The range that can be born.The scheme of the present embodiment proposes a kind of distributed system from the global traffic of limitation distributed system The solution for current limliting of uniting is as shown in Figure 2 A a kind of this specification distributed system shown according to an exemplary embodiment Current-limiting method flow chart, wherein include multiple nodes in the distributed system, include at least one in the multiple node Host node and at least one child node, comprising:
In step 202, after each node determines that current limliting is triggered, by the request to be processed of load balancer transmission It intercepts into Message Processing queue.
In step 204, the host node, will after the request to be processed that setting quantity is chosen in the Message Processing queue The request to be processed chosen is distributed at least one described node.
In step 206, after the child node receives the request to be processed that the host node is distributed, request processing is executed Process.
Optionally, the trigger timing or condition of flexible configuration current limliting be can according to need in practical application, by way of example, can To be that can be artificial current limliting of initiating using the trigger timing at the beginning of advertising campaign as current limliting and instruct, be also possible to root According to uninterrupted automatic trigger current limliting, it can also be situations such as abnormal progress current limliting etc. occur in distributed system.Specifically, institute It states the quantity that a kind of mode that determining current limliting is triggered is request to be processed and reaches setting current limit threshold, wherein the current limit threshold Can according to need flexible setting, be based on this, the present embodiment can the current total flow of monitoring system in a distributed system it is big It is small, if it exceeds the current limiting threshold of setting, then Dynamic trigger current limliting, and according in the certain period of time of backstage configuration flow it is big It is small come dynamic current limiting.Optionally, determine that the other modes that current limliting is triggered can also receive setting current limliting instruction, dynamic current limiting Switch can also be by backstage configuration by manually triggering, to achieve the purpose that protect distributed system.
In the present embodiment, the size of flow can be by the calculating of the quantity to request to be processed come real in distributed system It is existing.As shown in Figure 2 B, distributed system can collect the flow in current system, such as can be by requesting all global note every time Number, by way of example, the Incr of Redis can be used) realize, wherein Redis be being write using ANSI C an of open source, Support network, it is memory-based also can persistence log type, Key-Value database, and provide the API of multilingual. The digital value stored in key can be increased one by the Incr order of Redis.Specifically, each node connects the same Redis in system (independently and its either cluster is all possible), node remember that a number (calls Redis's for each request to be processed Incr is realized) so that recording the whole flow of distributed system in Redis.It is appreciated that can spirit as needed in practical application Selection other modes living, the present embodiment do not limit this.
Furthermore it is possible to (optionally, can be the maximum in the unit time in the backstage of distributed system configuration current limit threshold Number of request), when flow system flow reaches current limit threshold, current limiting switch can be automatically turned on, determines and executes current limliting processing;In other examples In, it is also possible to manually trigger current limiting switch on backstage, distributed system starts to carry out current limliting processing later.
In the present embodiment, the node in distributed system can receive the request to be processed of load balancer transmission, if point The normal inactive current limliting of the flow of cloth system, then each node receives the to be processed of load balancer transmission in distributed system After request, directly request to be processed can be handled.In the case where needing current limliting, each node is for load in the present embodiment The request to be processed that balanced device is sent will not be handled directly, but request to be processed is intercepted into Message Processing queue (optional, can be realized using the priority query zset of Redis), fishes for setting number by host node from Message Processing queue Each node is distributed to after the request of amount to be handled.The present embodiment limits the quantity of request to be processed using host node, can To prevent impact of the big flow to each node.
Optionally, problem caused by Message Processing queue exception, request to be processed can also be backed up simultaneously in order to prevent It under Message Processing queue abnormal conditions, can also be got from database to be processed to database for use as data of revealing all the details Request.
A host node (Master node) can be determined in the present embodiment from each node of distributed system, after being used for Continuous message distribution.Optionally, determine that host node can be there are many implementation.In some instances, can be by distribution In system each node according to setting rule select one of node as host node, optionally, the setting rule can be with Machine is chosen, and can be based on node software and hardware resources selection etc.;It can also be configured by technical staff.It is additionally provided in the present embodiment The implementation of election mechanism, host node are elected to obtain by all nodes by election mechanism, elect one by each node A Master node, by way of example, can be realized by the Master election mechanism of Zookeeper, wherein Zookeeper is One distributed, open source code distributed application program coordination service.
In the present embodiment, other nodes except host node are known as child node, are based on this, each section in distributed system Point can determine it itself is host node or child node.For host node, setting quantity can be chosen from Message Processing queue Request to be processed be distributed at least one described node, optionally, request to be processed can be divided based on load balancing Hair, whether it includes host node itself that the node of distribution does not limit, does not also limit and whether is distributed to all child nodes either part Child node.Optionally, which can be determined, the present embodiment based on the uninterrupted that can bear in distributed system It does not limit this.Wherein, the priority of various requests to be processed is provided in Message Processing queue in advance, such as can be according to The priority of some products is ranked up or is that business is ranked up according to other dimensions etc. as desired, practical application In can flexible configuration as needed, the present embodiment do not limit this.
Optionally, since processing of the node to the request to be processed distributed needs certain time, host node can be according to The period is set from from the Message Processing queue selection request to be processed, that is to say that host node is chosen at regular intervals, As an example, the period is set as 10 seconds, then host node was chosen primary and is distributed every 10 seconds, which is used for each The processing that node makes requests.Wherein, which can according to need flexible configuration, such as the processing capacity based on node And determine, the present embodiment does not limit this.As a kind of implementation, can in Master node configuring timing tasks, To after the trigger time of timed task, request to be processed is chosen according to priority from Message Processing queue, it is specific to choose Quantity can be determined by the current limliting number of backstage configuration.Finally, the request to be processed of selection is distributed to distributed system by host node Node in system.After each node receives solicited message in distributed system, it can be requested according to normal flow processing.
Optionally, since the request to be processed that each node also sends load balancer is backed up in database, If the Message Processing queue is operating abnormally, host node can also select request to be processed from the database.Wherein, node After request to be processed is completed in processing, can in more new database the request processing status, which can be processing It completes or untreated etc., it therefore, can be according to the processing requested in database when choosing request to be processed in host node database State chooses request to be processed.
Next it is illustrated again by Fig. 2 C, each node can configure a global interception in distributed system Device is responsible for intercepting request to be processed.Using the blocker, first determine whether current limiting switch is opened, current limiting switch unlatching has more The possible situation of kind: the flow that for example can be system reaches the threshold value of backstage default triggering current limliting;It can also be manually on backstage Configuration triggering current limliting strategy.Request is normally handled by normal processing logic if not starting to.If it find that opening limit Request to be processed is then first stored in database by stream switch, then will be in the priority query Zset of solicited message write-in Redis The precedence information in face, request is read from the priority configuration of backstage configuration.Optionally, request originator can also be returned to Relevant information of the request to be processed in process processed.Optionally, it can also be generated for each request to be processed global Unique distribution order number can also be sent out after the completion of the request to be processed is processed for request originator query processing progress The solicited message of the message informing request originator order number is sent to be disposed.Wherein, it is completed for processing to be processed Request, can also update the processing status of the request in the database.
As shown in Figure 2 D, each node in distributed system all configures the timed task of certain period of time triggering (such as how many minute/how many second etc. can configure according to business demand).According to the timed task, node can be according to setting week Phase judges whether itself is Master node, then without any processing if not Master node, if it is Master node Then take solicited message inside the priority query of Redis, (how many points of quantity from the current limliting of backstage configuration of the quantity of selection Clock/current limlitings how many number of request such as how many seconds), if taking solicited message to be abnormal inside Redis, from database the inside Choose request to be processed.
For a plurality of request to be processed of selection, each node that can be distributed to by host node in cluster is handled, Each node can configure a request processing flow, and when node receives the request to be processed of distribution, then trigger request is handled Process starts business logic processing, the processing status of current solicited message order number related data can be updated after the completion of processing, The request originator request can also be sent messages to be disposed.
The present embodiment is different from traditional single machine list example current limliting scheme, goes out from completely new distributed system current limliting angle Hair carries out current limliting detection in real time, had both supported automatic trigger current limliting or had supported artificial triggering current limliting, and specific current limliting number can also be with Dynamic configuration is carried out by backstage, and for the persistence of solicited message other than supporting to choose inside priority query, There are also the data of revealing all the details of database to support, and has ensured the stability of request data.
For request originator, current limliting strategy is transparent unaware to request originator, request hair before and after current limliting Processing status can be requested by the order number active inquiry once requested by playing side, also be notified that client after the completion of request processing End request disposition.For the loading condition of distributed system, Master node is to support election (Zookeeper Master election mechanism), even if Master node is hung, other nodes can also become again Master section by election mechanism Point;And the distribution of task is also load balancing, other nodes by load balancing being distributed in cluster.
The present embodiment carries out current limliting detection from completely new distributed system current limliting angle in real time, and dynamic opens limit Flow Policy, request to be processed can be handled by consumption to each node load balancing in systems.
The current limliting scheme of the present embodiment is entirely transparent, client before and after unlatching current limliting strategy for request originator End is unaware, is not born for request originator, does not need to do any additional processing.
In the present embodiment, the current limliting number of one side system can be by the configuration dynamic expansion of background system, another aspect, The number of nodes that request is handled in system can also dynamically increase, and only need to extend application distribution formula, because one The distributed system node of extension is both the alternate node and child node of Master node, can be the processing of request message It reduces processing pressure and achievees the purpose that the protection system of current limliting to alleviate the pressure of entire distributed system cluster.
In the present embodiment, the Master node in one side system can be elected by remaining node and be obtained after hanging; On the other hand after some child nodes hang, influence to whole system will not be especially big, and the flow of whole system still can be with Load balancing it is distributed to other child nodes.
As shown in figure 3, being the current limliting side of this specification another distributed system shown according to an exemplary embodiment The flow chart of method, this method can be applied to any node in distributed system, which comprises
In step 302, after determining that current limliting is triggered, the request to be processed that load balancer is distributed is intercepted to message It manages in queue;
In step 304, determine it itself is host node either child node;
Within step 306, if host node, after the request to be processed that setting quantity is chosen in the Message Processing queue, The request to be processed of selection is distributed at least one described node;
In step 308, if child node, then after the request for receiving host node distribution, request processing flow is executed.
Optionally, the host node chooses the request to be processed from the Message Processing queue according to the setting period.
Optionally, the host node is elected to obtain by all nodes by election mechanism.
Optionally, the determining current limliting is triggered, comprising: and the quantity of request to be processed reaches setting current limit threshold, or It is to receive setting current limliting instruction.
Optionally, the method also includes: by load balancer send request to be processed back up in database.
Optionally, the method also includes: for processing complete request to be processed, update the request in the database Processing status.
Optionally, the method also includes: if the Message Processing queue is operating abnormally, the host node is from the data Request to be processed is chosen in library.
Optionally, the host node is to choose setting the to be processed of quantity from the Message Processing queue according to priority to ask It asks.
The current limliting scheme of the present embodiment is the angle of each node from distributed system to describe, specific process flow It can refer to the description of Fig. 2A to Fig. 2 D illustrated embodiment, details are not described herein.
Corresponding with the embodiment of the current-limiting method of aforementioned distributed system, this specification additionally provides distributed system The embodiment of current-limiting apparatus and its applied terminal.
The embodiment of the current-limiting apparatus of this specification distributed system can be applied on a computing device, such as server Or terminal device.Installation practice can also be realized by software realization by way of hardware or software and hardware combining. Taking software implementation as an example, as the device on a logical meaning, being will be non-volatile by the processor of file process where it Property memory in corresponding computer program instructions be read into memory operation formed.For hardware view, such as Fig. 4 institute Show, is a kind of hardware structure diagram of computer equipment where the current-limiting apparatus of this specification distributed system, in addition to shown in Fig. 4 Except processor 410, memory 430, network interface 420 and nonvolatile memory 440, in embodiment where device 431 Server or electronic equipment can also include other hardware generally according to the actual functional capability of the computer equipment, no longer superfluous to this It states.
As shown in figure 5, Fig. 5 is a kind of this specification block diagram of device shown according to an exemplary embodiment, the dress It sets and includes:
Blocking module 51, is used for: after determining that current limliting is triggered, the request to be processed that load balancer is distributed being intercepted to disappearing In breath processing queue;
Determining module 52, is used for: determining it itself is host node either child node;
Distribution module 53, is used for: if host node, the request to be processed of setting quantity is chosen from the Message Processing queue Afterwards, the request to be processed of selection is distributed at least one described node;
Processing module 54, is used for: if child node, then after the request for receiving host node distribution, executing request processing stream Journey.
Optionally, the host node chooses the request to be processed from the Message Processing queue according to the setting period.
Optionally, the host node is elected to obtain by all nodes by election mechanism.
Optionally, the blocking module, is also used to: the quantity of request to be processed reaches setting current limit threshold, or connects Receive setting current limliting instruction.
Optionally, described device further includes backup module, is used for: by load balancer send request to be processed backup in In database.
Optionally, the method also includes: for processing complete request to be processed, update the request in the database Processing status.
Optionally, the distribution module is also used to: if the Message Processing queue is operating abnormally, the host node is from described Request to be processed is chosen in database.
Optionally, the host node is to choose setting the to be processed of quantity from the Message Processing queue according to priority to ask It asks.
Correspondingly, this specification also provides a kind of computer equipment, including memory, processor and storage are on a memory And the computer program that can be run on a processor, wherein the processor realizes aforementioned distributed system when executing described program The current-limiting method of system.
The function of modules and the realization process of effect are specifically detailed in above-mentioned in the current-limiting apparatus of above-mentioned distributed system The realization process of step is corresponded in the current-limiting method of distributed system, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The module of explanation may or may not be physically separated, and the component shown as module can be or can also be with It is not physical module, it can it is in one place, or may be distributed on multiple network modules.It can be according to actual The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not In the case where making the creative labor, it can understand and implement.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can With or may be advantageous.
Those skilled in the art will readily occur to this specification after considering specification and practicing the invention applied here Other embodiments.This specification is intended to cover any variations, uses, or adaptations of this specification, these modifications, Purposes or adaptive change follow the general principle of this specification and do not apply in the art including this specification Common knowledge or conventional techniques.The description and examples are only to be considered as illustrative, the true scope of this specification and Spirit is indicated by the following claims.
It should be understood that this specification is not limited to the precise structure that has been described above and shown in the drawings, And various modifications and changes may be made without departing from the scope thereof.The range of this specification is only limited by the attached claims System.
The foregoing is merely the preferred embodiments of this specification, all in this explanation not to limit this specification Within the spirit and principle of book, any modification, equivalent substitution, improvement and etc. done should be included in the model of this specification protection Within enclosing.

Claims (14)

1. a kind of current-limiting method of distributed system, includes multiple nodes in the distributed system, wrapped in the multiple node At least one host node and at least one child node are included, the current-limiting method includes:
After each node determines that current limliting is triggered, the request to be processed that load balancer is sent is intercepted to Message Processing team In column;
The host node is after the request to be processed that setting quantity is chosen in the Message Processing queue, by the request to be processed of selection It is distributed at least one described node;
After the child node receives the request to be processed of the host node distribution, request processing flow is executed.
2. according to the method described in claim 1, the host node chooses institute from the Message Processing queue according to the setting period State request to be processed.
3. according to the method described in claim 1, the host node is elected to obtain by all nodes by election mechanism.
4. according to the method described in claim 1, the determining current limliting is triggered, comprising: the quantity of request to be processed, which reaches, to be set Determine current limit threshold, or receives setting current limliting instruction.
5. according to the method described in claim 1, the method also includes: each node also load balancer is sent Request backup to be processed is in database.
6. according to the method described in claim 5, the method also includes: for processing complete request to be processed, in data The processing status of the request is updated in library.
7. according to the method described in claim 6, the method also includes: if the Message Processing queue be operating abnormally, it is described Host node chooses request to be processed from the database.
8. according to the method described in claim 1, the host node is to set according to priority from Message Processing queue selection The request to be processed of fixed number amount.
9. a kind of current-limiting method of distributed system, the method is applied to any node in distributed system, the method packet It includes:
After determining that current limliting is triggered, the request to be processed that load balancer is distributed is intercepted into Message Processing queue;
Determine it itself is host node either child node;
If host node, after the request to be processed that setting quantity is chosen in the Message Processing queue, to be processed by selection is asked It asks and is distributed at least one described node;
If child node, then after the request for receiving host node distribution, request processing flow is executed.
10. according to the method described in claim 9, further include: the request to be processed for sending load balancer is backed up in data In library.
11. according to the method described in claim 10, the method also includes: for processing complete request to be processed, in number According to the processing status for updating the request in library.
12. the method according to claim 11, the method also includes: if the Message Processing queue is operating abnormally, institute It states host node and chooses request to be processed from the database.
13. a kind of current-limiting apparatus of distributed system, described device is applied to any node in distributed system, described device packet It includes:
Blocking module is used for: after determining that current limliting is triggered, the request to be processed that load balancer is distributed being intercepted to Message Processing In queue;
Determining module is used for: determining it itself is host node either child node;
Distribution module is used for:, will after the request to be processed that setting quantity is chosen in the Message Processing queue if host node The request to be processed chosen is distributed at least one described node;
Processing module is used for: if child node, then after the request for receiving host node distribution, executing request processing flow.
14. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, wherein the processor realizes the method as described in claim 1 to 12 is any when executing described program.
CN201811505451.5A 2018-12-10 2018-12-10 Current limiting method, device and equipment of distributed system Active CN110049084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811505451.5A CN110049084B (en) 2018-12-10 2018-12-10 Current limiting method, device and equipment of distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811505451.5A CN110049084B (en) 2018-12-10 2018-12-10 Current limiting method, device and equipment of distributed system

Publications (2)

Publication Number Publication Date
CN110049084A true CN110049084A (en) 2019-07-23
CN110049084B CN110049084B (en) 2021-08-24

Family

ID=67273733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811505451.5A Active CN110049084B (en) 2018-12-10 2018-12-10 Current limiting method, device and equipment of distributed system

Country Status (1)

Country Link
CN (1) CN110049084B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460541A (en) * 2019-07-30 2019-11-15 秒针信息技术有限公司 Current-limiting method and device applied to web server
CN113032410A (en) * 2019-12-25 2021-06-25 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer storage medium
CN114070847A (en) * 2020-07-27 2022-02-18 腾讯科技(深圳)有限公司 Current limiting method, device, equipment and storage medium of server

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188345A (en) * 2013-03-01 2013-07-03 北京邮电大学 Distributive dynamic load management system and distributive dynamic load management method
CN103268321A (en) * 2013-04-19 2013-08-28 中国建设银行股份有限公司 Data processing method and device for high concurrency transaction
CN103945005A (en) * 2014-05-06 2014-07-23 江苏物联网研究发展中心 Multiple evaluation indexes based dynamic load balancing framework
CN106453564A (en) * 2016-10-18 2017-02-22 北京京东尚科信息技术有限公司 Elastic cloud distributed massive request processing method, device and system
CN106657416A (en) * 2017-03-02 2017-05-10 北京邮电大学 Method and device for balancing load of controllers
US20170302212A1 (en) * 2016-04-15 2017-10-19 Emerson Climate Technologies, Inc. Driver For High-Frequency Switching Voltage Converters
CN108111333A (en) * 2017-11-22 2018-06-01 链家网(北京)科技有限公司 A kind of flow limitation method and system based on WEB
CN108282411A (en) * 2017-12-29 2018-07-13 北京五八信息技术有限公司 A kind of access current-limiting method, device, equipment and computer readable storage medium
CN108958789A (en) * 2018-05-20 2018-12-07 湖北九州云仓科技发展有限公司 A kind of parallel streaming calculation method, electronic equipment, storage medium and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188345A (en) * 2013-03-01 2013-07-03 北京邮电大学 Distributive dynamic load management system and distributive dynamic load management method
CN103268321A (en) * 2013-04-19 2013-08-28 中国建设银行股份有限公司 Data processing method and device for high concurrency transaction
CN103945005A (en) * 2014-05-06 2014-07-23 江苏物联网研究发展中心 Multiple evaluation indexes based dynamic load balancing framework
US20170302212A1 (en) * 2016-04-15 2017-10-19 Emerson Climate Technologies, Inc. Driver For High-Frequency Switching Voltage Converters
CN106453564A (en) * 2016-10-18 2017-02-22 北京京东尚科信息技术有限公司 Elastic cloud distributed massive request processing method, device and system
CN106657416A (en) * 2017-03-02 2017-05-10 北京邮电大学 Method and device for balancing load of controllers
CN108111333A (en) * 2017-11-22 2018-06-01 链家网(北京)科技有限公司 A kind of flow limitation method and system based on WEB
CN108282411A (en) * 2017-12-29 2018-07-13 北京五八信息技术有限公司 A kind of access current-limiting method, device, equipment and computer readable storage medium
CN108958789A (en) * 2018-05-20 2018-12-07 湖北九州云仓科技发展有限公司 A kind of parallel streaming calculation method, electronic equipment, storage medium and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460541A (en) * 2019-07-30 2019-11-15 秒针信息技术有限公司 Current-limiting method and device applied to web server
CN113032410A (en) * 2019-12-25 2021-06-25 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113032410B (en) * 2019-12-25 2024-05-03 阿里巴巴集团控股有限公司 Data processing method, device, electronic equipment and computer storage medium
CN114070847A (en) * 2020-07-27 2022-02-18 腾讯科技(深圳)有限公司 Current limiting method, device, equipment and storage medium of server
CN114070847B (en) * 2020-07-27 2024-01-23 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for limiting current of server

Also Published As

Publication number Publication date
CN110049084B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
US10467105B2 (en) Chained replication techniques for large-scale data streams
US10691716B2 (en) Dynamic partitioning techniques for data streams
US10795905B2 (en) Data stream ingestion and persistence techniques
US9471585B1 (en) Decentralized de-duplication techniques for largescale data streams
US9794135B2 (en) Managed service for acquisition, storage and consumption of large-scale data streams
US10635644B2 (en) Partition-based data stream processing framework
CN109189334B (en) Block chain network service platform, capacity expansion method thereof and storage medium
US7418489B2 (en) Method and apparatus for applying policies
US5687372A (en) Customer information control system and method in a loosely coupled parallel processing environment
US8904361B2 (en) Non-intrusive method for logging of internal events within an application process, and system implementing this method
US20050028171A1 (en) System and method enabling multiple processes to efficiently log events
CN108132830A (en) A kind of method for scheduling task, apparatus and system
US11188561B2 (en) Prioritizing microservices on a container platform for a restore operation
US20150135255A1 (en) Client-configurable security options for data streams
US7568131B2 (en) Non-intrusive method for logging external events related to an application process, and a system implementing said method
CN111338773A (en) Distributed timed task scheduling method, scheduling system and server cluster
CN110049084A (en) Current-limiting method, device and the equipment of distributed system
EP0747813A2 (en) Customer information control system and method with temporary storage queuing functions in a loosely coupled parallel processing environment
US5790868A (en) Customer information control system and method with transaction serialization control functions in a loosely coupled parallel processing environment
CN110928662A (en) Distributed timing task scheduler facing micro-service architecture
EP0747812A2 (en) Customer information control system and method with API start and cancel transaction functions in a loosely coupled parallel processing environment
US9501517B2 (en) Providing consistent tenant experiences for multi-tenant databases
US20070174688A1 (en) Method for optimizing the transmission of logging data in a multi-computer environment and a system implementing this method
US11870706B2 (en) Method and system for allocating and managing cloud resources
EP3389222B1 (en) A method and a host for managing events in a network that adapts event-driven programming framework

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant