CN102299959B - Load balance realizing method of database cluster system and device - Google Patents

Load balance realizing method of database cluster system and device Download PDF

Info

Publication number
CN102299959B
CN102299959B CN 201110241232 CN201110241232A CN102299959B CN 102299959 B CN102299959 B CN 102299959B CN 201110241232 CN201110241232 CN 201110241232 CN 201110241232 A CN201110241232 A CN 201110241232A CN 102299959 B CN102299959 B CN 102299959B
Authority
CN
China
Prior art keywords
database server
node
subregion
weighted value
affairs
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.)
Expired - Fee Related
Application number
CN 201110241232
Other languages
Chinese (zh)
Other versions
CN102299959A (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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN 201110241232 priority Critical patent/CN102299959B/en
Publication of CN102299959A publication Critical patent/CN102299959A/en
Application granted granted Critical
Publication of CN102299959B publication Critical patent/CN102299959B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a load balance realizing method of a database cluster system and a device. The method comprises the following steps that: a load balancer models a conflict relationship between a being executed affair of each database server and a concurrent affair requested by a client side to form an undirected graph with a weighted value; the undirected graph is partitioned into k subregions by using a graph partitioning method, and partitioning all the requested affair nodes into the corresponding subregions according to the partitioning principle that the sum of the weighted values of sides crossing different subregions is the minimum, and meanwhile, the weighted value of the database server node in each subregion reaches balance, wherein k is the total number of all database server nodes; and assigning the requested affairs to the database server in the same subregion one by one according to a partitioning result to be executed and processed. The load balance realizing method of the database cluster system and the device belong to the technical field of information, which can assign affairs with the conflict relationship to the least one database server as much as possible, and meanwhile, enables the database servers to reach load balance.

Description

A kind of load balancing implementation method and device of data base cluster system
Technical field
The present invention relates to a kind of load balancing implementation method and device of data base cluster system, belong to areas of information technology.
Background technology
Data base cluster system refers to the mode of one group of database server with cluster combined, and uses unified interface to provide service to the user.The data trnascription that the data base cluster system utilization is kept on a plurality of database servers obtains higher availability; And utilize a plurality of database servers provide single Database Systems the more powerful data managing capacity that can't provide and the inquiry response efficient of Geng Gao.
Consistency in the data base cluster system between a plurality of database servers can realize by the database replication agreement based on authentication, its process is as follows: each database server is of equal value, the transactions requests that client is sent (as inquiry, more operation such as new data) is carried out by a database server earlier, if these affairs are read-only affairs, then directly submit to and reply by this database server to get final product; If these affairs relate to the renewal of data, then broadcast the rewriting collection of these affairs and notify other all database servers.When the affairs that receive broadcasting when other database server are rewritten collection, can carry out an authentication to these affairs: if having on this database server submitted to and with upgrade the afoul affairs of affairs, then these renewal affairs will be ended; If do not upgrade the afoul affairs of affairs with this, these affairs can be submitted to identical order on all database servers.That is to say that it is different that load equalizer is distributed to the affairs of each database server, the consistency between the database server is guaranteed by the replication protocol based on authentication.Under this scene, how to choose the transactions requests that most effective database server is carried out client, be the key technology that determines whole group system reply efficiency.
Because the different affairs in the system may need to visit jointly some common data items, if wherein have at least affairs to have write operation, conflict in the time of then can causing the common visit data of these affairs, namely have conflict relationship between these affairs.When two affairs that have a conflict relationship were carried out in different database servers, one of them affairs just might be ended to carry out, if the collision rate between the affairs is higher, then can cause the raising of System Halt rate and the reduction of concurrent processing ability.On the contrary, transfer to same database server and carry out if will have the affairs of conflict relationship, at this moment the concurrent control mechanism of database server this locality can effectively solve these collision problems, thus the termination rate when reducing affairs and carrying out.Therefore, we wish can will have the affairs of conflict relationship concentrate on as much as possible on the minimum database server and carry out.
But the affairs that will have conflict relationship are concentrated the database server of distributing to minority, might cause the unbalanced problem of load: the database server generation data overload of minority; Other database servers are in idle state.Can produce corresponding lock conflict owing to solve the affairs conflict, the database server of minority can form data overload because of too much lock conflict, when data overload takes place, increasing affairs are blocked in the executive process, the response time of affairs increases greatly, and too much termination simultaneously also can cause a large amount of wastes of resource.At present, generally the database cluster system load balancing method of Shi Yonging includes: random choice method, polling method, WRR method etc., however these methods are not all considered the conflict relationship between the affairs.
Document " Conflict-aware load-balancing techniques for database replication " (publishing in 2008ACMsymposium on Applied computing.March16-202008) has proposed a kind of conflict perception load-balancing technique for data base cluster system (being called for short MPF).This MPF scheme is by the adjustment of parameter f, thereby realized the affairs number of collisions minimize and and the maximization target of line number, but because following factor is depended in the selection of parameter f to a great extent: number of deals, complexity and the system load of conflict mutually, thereby cause final result to have certain uncertainty and complexity, still have at each database server simultaneously the data overload phenomenon may take place.
Therefore, the affairs that how will have conflict relationship are dispensed on the minimum database server as much as possible, can also make each database server reach load balancing simultaneously, just become a new problem of scientific and technical personnel's concern in the industry.
Summary of the invention
In view of this, the load balancing implementation method and the device that the purpose of this invention is to provide a kind of data base cluster system, the affairs that can will have conflict relationship are dispensed on the minimum database server as much as possible, also make each database server reach load balancing simultaneously.
In order to achieve the above object, the invention provides a kind of load balancing implementation method of data base cluster system, described method includes:
Step 1, load equalizer are modeled as the non-directed graph with weighted value with the conflict relationship between the concurrent transaction of the affairs of carrying out of each database server and client-requested, wherein the concurrent transaction of client-requested abbreviates request transaction as: in this non-directed graph, set of node is the set of database server node and request transaction node, wherein the database server node represents all affairs carried out on this database server, and the request transaction node represents the concurrent transaction of client-requested; The limit collection is affairs and the set of carrying out on the database server of the conflict relationship between the request transaction, and the conflict relationship between the wherein said affairs refers to the common same data items of visit of a plurality of affairs and wherein has at least affairs to have write operation; The weighted value of described node depends on that the weighted value of request transaction or on the database server all are carrying out the weighted value sum of affairs, and wherein the weighted value of affairs depends on the complexity of affairs; The weighted value on described limit depends on the data item sum of the common visit of affairs of two node representatives that have conflict relationship;
The split plot design of step 2, employing figure, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, simultaneously the database server node weights value in each subregion reaches balanced area principle, with all request transaction node division in corresponding subregion;
Step 3, load equalizer are according to the subregion result of step 2, and the database server of one by one request transaction being distributed in the same subregion is carried out, handled,
Described step 2 further includes:
Step 21, the total weights W of computing node TotalWith database server load balancing weights W Average, wherein, W TotalBe the weighted value sum of all nodes in the non-directed graph,
Figure GSB00001105056400031
Expression is to rounding on the χ;
Step 22, the subregion S set (t) that setting can be divided and the subregion set P (t) that has divided, and to S (t), P (t) difference initialization: S (t)={ S 1, S 2..., S k, S wherein 1, S 2..., S kRepresent K subregion, each the database server node during initialization in the non-directed graph is divided in the different subregions of S (t), i.e. each database server node unique subregion that belongs among the S (t) behind subregion; P (t) is empty set;
Step 23, judge that whether the weighted value of the database server node that each section post among the S (t) comprises is greater than W one by one AverageIf the weighted value of database server node is greater than W Average, then from S (t), move to described subregion among the P (t);
Do you step 24, judge the request transaction node that whether is not divided into subregion in the non-directed graph in addition? if then continue step 25; If not, then this flow process finishes;
Step 25, extract a request transaction node that is not divided into subregion, judge that subregion number that S (t) comprises is greater than 0? if then continue step 26; If not, then continue step 27;
In step 26, the judgement non-directed graph, do other nodes that link to each other with described request affairs node have the node that belongs to the subregion among the S (t)? if, then from the subregion of S (t), find the subregion of a S (t) of the weighted value summation maximum on the limit that links to each other with described request affairs node, with described request affairs node division in described subregion, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23; If not, the weighted value that then compares the database server node of all subregions among the S (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23;
The weighted value of the database server node of all subregions among step 27, the comparison P (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 24.
In order to achieve the above object, the present invention also provides a kind of load balancing device of data base cluster system, includes:
Load equalizer, connect client and database server, be used for receiving the concurrent transaction of client-requested, wherein the concurrent transaction of client-requested abbreviates request transaction as, and the affairs of carrying out of each database server and the conflict relationship between the request transaction are modeled as the non-directed graph with weighted value, adopt the split plot design of figure then, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, database server node weights value in each subregion reaches balanced area principle simultaneously, with all request transaction node division in corresponding subregion, at last according to the subregion result, the database server that the described request affairs are distributed in the same subregion is carried out
Wherein, adopt the split plot design of figure, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, the database server node weights value in each subregion reaches balanced area principle simultaneously, all request transaction node division in corresponding subregion, are further included:
Step 21, the total weights W of computing node TotalWith database server load balancing weights W Average, wherein, W TotalBe the weighted value sum of all nodes in the non-directed graph,
Figure GSB00001105056400041
Figure GSB00001105056400042
Expression is to rounding on the χ;
Step 22, the subregion S set (t) that setting can be divided and the subregion set P (t) that has divided, and to S (t), P (t) difference initialization: S (t)={ S 1, S 2..., S k, S wherein 1, S 2..., S kRepresent K subregion, each the database server node during initialization in the non-directed graph is divided in the different subregions of S (t), i.e. each database server node unique subregion that belongs among the S (t) behind subregion; P (t) is empty set;
Step 23 judges that one by one whether the weighted value of the database server node that each section post among the S (t) comprises is greater than W AverageIf the weighted value of database server node is greater than W Average, then from S (t), move to described subregion among the P (t);
Do you step 24, judge the request transaction node that whether is not divided into subregion in the non-directed graph in addition? if then continue step 25; If not, then this flow process finishes;
Step 25, extract a request transaction node that is not divided into subregion, judge that subregion number that S (t) comprises is greater than 0? if then continue step 26; If not, then continue step 27;
In step 26, the judgement non-directed graph, do other nodes that link to each other with described request affairs node have the node that belongs to the subregion among the S (t)? if, then from the subregion of S (t), find the subregion of a S (t) of the weighted value summation maximum on the limit that links to each other with described request affairs node, with described request affairs node division in described subregion, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23; If not, the weighted value that then compares the database server node of all subregions among the S (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23;
The weighted value of the database server node of all subregions among step 27, the comparison P (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 24.
Compared with prior art, the invention has the beneficial effects as follows: the present invention has considered conflict relationship between the affairs and the problem of load balancing of data base cluster system simultaneously, at first the conflict relationship between the request transaction of database server and client is modeled as the non-directed graph with weighted value, adopt the split plot design of figure again, weighted value summation minimum according to the limit of crossing over different subregions, database server node weights value in each subregion reaches balanced area principle simultaneously, in the subregion with all request transaction node division each database server node place in the system, thereby the affairs that will have conflict relationship are dispensed on the minimum database server as much as possible, effectively reduce the termination rate, also make each database server reach load balancing simultaneously; Because lock conflict can take place in database server when handling the affairs of conflict mutually, therefore the execution of the affairs in each database server and completion status are followed the tracks of, if when monitoring conflict ratio value Thrashing in the database server greater than conflict critical value CR, then postpone the execution of next request transaction in this database server, thereby effectively avoided forming the data overload phenomenon because of too much lock conflict.
Description of drawings
Fig. 1 is the load balancing implementation method flow chart of a kind of data base cluster system of the present invention.
Fig. 2 is the schematic diagram that the affairs of carrying out of database server and the conflict relationship between the request transaction is modeled as an embodiment of non-directed graph.
Fig. 3 is the concrete operations flow chart of Fig. 1 step 2.
Fig. 4 is at non-directed graph embodiment shown in Figure 2, and the split plot design of employing figure is carried out result schematic diagram behind the subregion with all request transaction nodes.
Fig. 5 is the concrete operations flow chart when load equalizer distributes a request transaction to described database server.
The composition structural representation of a kind of data base cluster system of Fig. 6 the present invention.
Termination rate when Fig. 7 is employing Random, MPF, GBCA is with the change curve of client linking number.
Fig. 8 is that the database server load Distribution is with the change curve of client linking number when adopting Random, MPF, GBCA respectively.
Throughput when Fig. 9 is employing Random, MPF, GBCA is with the change curve of client linking number.
Average response time when Figure 10 is employing Random, MPF, GBCA is with the change curve of client linking number.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with the good embodiment of accompanying drawing.
Referring to Fig. 1, client sends the concurrent transaction request to load equalizer, and after load equalizer received several concurrent transaction requests simultaneously, the load balancing implementation method of a kind of data base cluster system of the present invention included:
Step 1, load equalizer are modeled as the non-directed graph with weighted value with the conflict relationship between the concurrent transaction (abbreviation request transaction) of the affairs of carrying out and the client-requested of each database server: in this non-directed graph, set of node is the set of database server node and request transaction node, wherein the database server node represents all affairs carried out on this database server, and the request transaction node represents the concurrent transaction of client-requested; The limit collection is affairs and the set of carrying out on the database server of the conflict relationship between the request transaction, conflict relationship between the wherein said affairs refers to the common same data items of visit of a plurality of affairs and wherein has at least affairs to have write operation, when having conflict relationship between the affairs of carrying out on the database server and request transaction or the different request transaction, have a limit that connects above-mentioned two nodes between corresponding database server node and request transaction node or the different request transaction node; The weighted value of described node depends on that the weighted value of request transaction or on the database server all are carrying out the weighted value sum of affairs, and wherein the weighted value of affairs depends on the complexity of affairs, for example affairs time of implementation, occupying system resources etc.; The weighted value on described limit depends on the data item sum of the common visit of affairs of two node representatives that have conflict relationship, when having a limit between database server node and the request transaction node, the weighted value on described limit is all affairs of carrying out and the common data item sum of visiting of described request affairs on this database server, when having a limit between the different request transaction nodes, the weighted value on described limit be these two request transaction the data item sum of common visit.
As shown in Figure 2, the schematic diagram that to be the present invention be modeled as an embodiment of non-directed graph with the affairs of carrying out and the conflict relationship between the request transaction of database server.In this non-directed graph, include 3 database server nodes (as R 1, R 2, R 3) and 8 request transaction nodes (as T 1, T 2..., T 8), database server node R wherein 1On carrying out affairs T 1And T 3, the database server node R 3On carrying out affairs T 2, the concurrent transaction T of client-requested 4, T 5..., T 8Arrive load equalizer simultaneously, and press T by load equalizer 4, T 5..., T 8Order successively the dispatching database server carry out this request transaction.The complexity of setting all affairs equates that namely the weighted value of all affairs is 1, and the data item of the common visit of conflict transaction is 1.The database server node R 1On carrying out affairs T 1And T 3, so R 1The node weights value be affairs T 1And T 3The weighted value sum, i.e. R 1The node weights value be 2, same, the database server node R 3On carrying out affairs T 2, database server node R then 3The node weights value be 1, the database server node R 2On the affairs do not carried out, then database server node R 2The node weights value be 0.Because request transaction node T 4With the database server node R 3On execution affairs have conflict relationship, and the data item of common visit adds up to 1, so connection request affairs node T 4With the database server node R 3The weighted value on limit be 1, same, request transaction node T 4And T 6Have conflict relationship, and the data item of common visit adds up to 1, so connection request affairs node T 4And T 6The weighted value on limit be 1.
The split plot design of step 2, employing figure, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, simultaneously the database server node weights value in each subregion reaches balanced area principle, with all request transaction node division in corresponding subregion.
Step 3, load equalizer are according to the subregion result of step 2, and the database server of one by one request transaction being distributed in the same subregion is carried out, handled.
As shown in Figure 3, step 2 further includes:
Step 21, the total weights W of computing node TotalWith database server load balancing weights W Average, wherein, W TotalBe the weighted value sum of all nodes in the non-directed graph,
Figure GSB00001105056400071
Figure GSB00001105056400072
Expression is to rounding on the χ;
For example, for non-directed graph embodiment as shown in Figure 2, k=3, W Total=8, W Average=3.
Step 22, the subregion S set (t) that setting can be divided and the subregion set P (t) that has divided, and to S (t), P (t) difference initialization: S (t)={ S 1, S 2..., S k, S wherein 1, S 2..., S kRepresent K subregion, each the database server node during initialization in the non-directed graph is divided in the different subregions of S (t), i.e. each database server node unique subregion that belongs among the S (t) behind subregion; P (t) is empty set;
For example, for non-directed graph embodiment as shown in Figure 2, initialized S (t)={ S 1, S 2, S 3, database server node R wherein 1, R 2, R 3Belong to S respectively 1, S 2, S 3P(t)=0。
Step 23, judge that whether the weighted value of the database server node that each section post among the S (t) comprises is greater than W one by one AverageIf the weighted value of database server node is greater than W Average, then from S (t), move to described subregion among the P (t); Like this, in S (t) the database server node weights value of certain subregion greater than W AverageThe time, represent that then the load of this database server reaches the upper limit, will no longer continue to distribute other request transaction, reach balanced purpose thereby reach the weighted value that makes the database server node in each subregion mentioned in the step 2.
Do you step 24, judge the request transaction node that whether is not divided into subregion in the non-directed graph in addition? if then continue step 25; If not, then this flow process finishes.
Step 25, extract a request transaction node that is not divided into subregion, judge that subregion number that S (t) comprises is greater than 0? if then continue step 26; If not, then continue step 27;
Step 26, judge in the non-directed graph, do other nodes that link to each other with described request affairs node have the node that belongs to the subregion among the S (t)? if, then from the subregion of S (t), find the subregion of a S (t) of the weighted value summation maximum on the limit that links to each other with described request affairs node, it is the weighted value sum maximum on the limit that links to each other with all nodes that belong to described subregion of described request affairs node, with described request affairs node division in described subregion, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23; If not, the weighted value that then compares the database server node of all subregions among the S (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23;
Like this, can be according to conflict relationship, with the request transaction node division in the subregion of the weighted value summation maximum on the limit that links to each other with described request affairs node, thereby reach the purpose of the weighted value summation minimum that makes the limit of crossing over different subregions mentioned in the step 2.For example, for non-directed graph embodiment as shown in Figure 2, for request transaction node T 4, and T 4The node that links to each other includes: R 3, T 6, T 8, because T 6, T 8So subregion not also is and T 4The subregion of the S (t) of the weighted value summation maximum on the limit that links to each other is S 3, with T 4Be divided into S 3In, and with S 3In the database server node R 3Weighted value be updated to weighted value 1 sum 2 of former weighted value 1 and described request affairs node.
The weighted value of the database server node of all subregions among step 27, the comparison P (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 24.
Fig. 4 is at non-directed graph embodiment shown in Figure 2, and the split plot design of employing figure is carried out result schematic diagram behind the subregion with all request transaction nodes.Wherein, dotted line is represented the line of demarcation between the different subregions, T 5Be divided into R 1In the affiliated subregion, R 1The node weights value be 3; T 7, T 8Be divided into R 2In the affiliated subregion, R 2The node weights value be 2; T 4, T 6Be divided into R 3In the affiliated subregion, R 3The node weights value be 3.As can be seen from Figure 4, behind the subregion, the weighted value summation of crossing over the limit of different subregions reaches minimum, and the database server node weights value in each subregion reaches balanced.
What deserves to be mentioned is that the present invention can also effectively avoid the generation of data overload.Load equalizer is safeguarded a transactions requests formation for each database server, also affairs execution and the completion status of each database server are followed the tracks of simultaneously, if when monitoring conflict ratio value Thrashing in the database server greater than conflict critical value CR, then postpone the execution of next request transaction in this database server.Described CR is a real number, existing evidence, and the preferred value of CR is 1.3.
As shown in Figure 5, when load equalizer distributes a request transaction to described database server, also include:
Steps A, load equalizer read the total S of current all office's holder locks respectively from the lock table of database server AllTotal Snz with unblock office holder lock;
Step B, load equalizer calculate conflict ratio value Thrashing:
Do step C, load equalizer judge that described conflict ratio value Thrashing is less than conflict critical value CR? if then continue step D; If not, then load equalizer tail of the queue that this request transaction is put into the transactions requests formation is waited for;
Whether the transactions requests formation that step D, load equalizer are judged as described database server maintenance is empty, if, then directly dispatching this request transaction carries out to database server, if not, then this request transaction is put into the tail of the queue of transactions requests formation, dispatched the request transaction that is in head of the queue of transactions requests formation simultaneously and carry out to database server.
When load equalizer monitors database server when executing a request transaction, also include:
Step a, load equalizer read the total S of current all office's holder locks respectively from the lock table of database server AllWith the total Snz of unblock office holder lock, and calculate conflict ratio value Thrashing:
Figure GSB00001105056400082
Do step b, load equalizer judge that described conflict ratio value Thrashing is less than conflict critical value CR? if, then when the transactions requests formation of described database server was not sky, the request transaction that is in head of the queue of scheduling transactions requests formation was carried out to database server; If not, then load equalizer is not dispatched request transaction in the transactions requests formation.
As shown in Figure 6, the load balancing device of a kind of data base cluster system of the present invention includes:
Load equalizer, connect client and database server, be used for receiving the concurrent transaction (abbreviation request transaction) of client-requested, and the affairs of carrying out of each database server and the conflict relationship between the request transaction are modeled as the non-directed graph with weighted value, adopt the split plot design of figure then, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, database server node weights value in each subregion reaches balanced area principle simultaneously, with all request transaction node division in corresponding subregion, according to the subregion result, the database server that the described request affairs are distributed in the same subregion is carried out at last.
Described load equalizer further includes k transactions requests formation attending device:
Transactions requests formation attending device, be used for one of them database server is safeguarded a transactions requests formation, and simultaneously the affairs implementation in the described database server is followed the tracks of, if when monitoring conflict ratio value Thrashing in the database server greater than conflict critical value CR, then wait for the execution that continues next request transaction in this database server until Thrashing during less than CR again, wherein the conflict ratio value Thrashing in the database server:
Figure GSB00001105056400091
S All, Snz is respectively the sum of current all office's holder locks of reading from the lock table of database server and the sum of unblock office holder lock.
The applicant to the invention process emulation experiment repeatedly, to prove its feasibility.The data base cluster system of being made up of 8 database servers with employing is example, use at random load-balancing algorithm (being called for short Random), MPF, the present invention's (being called for short GBCA) to carry out l-G simulation test respectively, described load-balancing algorithm at random refers at random request transaction be distributed to a database server wherein.Termination rate when Fig. 7 shows employing Random, MPF, GBCA is with the change curve of number clients linking number; Database server load Distribution (percentage of the processing transactions of every database server) when Fig. 8 (a) and (b), (c) show employing Random, MPF, GBCA respectively is with the change curve of client linking number; Throughput when Fig. 9 shows employing Random, MPF, GBCA is with the change curve of client linking number; Average response time when Figure 10 shows employing Random, MPF, GBCA is with the change curve of client linking number.From the data analysis of experimental result, it is successful implementing test, behind application the present invention, can reduce the termination rate that causes because of the affairs conflict effectively, and makes the load of each database server reach balanced.

Claims (8)

1. the load balancing implementation method of a data base cluster system is characterized in that, described method includes:
Step 1, load equalizer are modeled as the non-directed graph with weighted value with the conflict relationship between the concurrent transaction of the affairs of carrying out of each database server and client-requested, wherein the concurrent transaction of client-requested abbreviates request transaction as: in this non-directed graph, set of node is the set of database server node and request transaction node, wherein the database server node represents all affairs carried out on this database server, and the request transaction node represents the concurrent transaction of client-requested; The limit collection is affairs and the set of carrying out on the database server of the conflict relationship between the request transaction, and the conflict relationship between the wherein said affairs refers to the common same data items of visit of a plurality of affairs and wherein has at least affairs to have write operation; The weighted value of described node depends on that the weighted value of request transaction or on the database server all are carrying out the weighted value sum of affairs, and wherein the weighted value of affairs depends on the complexity of affairs; The weighted value on described limit depends on the data item sum of the common visit of affairs of two node representatives that have conflict relationship;
The split plot design of step 2, employing figure, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, simultaneously the database server node weights value in each subregion reaches balanced area principle, with all request transaction node division in corresponding subregion;
Step 3, load equalizer are according to the subregion result of step 2, and the database server of one by one request transaction being distributed in the same subregion is carried out, handled;
Described step 2 further includes:
Step 21, the total weights W of computing node TotalWith database server load balancing weights W Average, wherein, W TotalBe the weighted value sum of all nodes in the non-directed graph,
Figure FSB00001105056300011
Figure FSB00001105056300012
Expression is to rounding on the χ;
Step 22, the subregion S set (t) that setting can be divided and the subregion set P (t) that has divided, and to S (t), P (t) difference initialization: S (t)={ S 1, S 2..., S k, S wherein 1, S 2..., S kRepresent K subregion, each the database server node during initialization in the non-directed graph is divided in the different subregions of S (t), i.e. each database server node unique subregion that belongs among the S (t) behind subregion; P (t) is empty set;
Step 23, judge that whether the weighted value of the database server node that each section post among the S (t) comprises is greater than W one by one AverageIf the weighted value of database server node is greater than W Average, then from S (t), move to described subregion among the P (t);
Step 24, judge the request transaction node that whether is not divided into subregion in the non-directed graph in addition, if then continue step 25; If not, then this flow process finishes;
Step 25, extract a request transaction node that is not divided into subregion, judge that whether subregion number that S (t) comprises is greater than 0, if then continue step 26; If not, then continue step 27;
In step 26, the judgement non-directed graph, whether other nodes that link to each other with described request affairs node have the node that belongs to the subregion among the S (t), if, then from the subregion of S (t), find the subregion of a S (t) of the weighted value summation maximum on the limit that links to each other with described request affairs node, with described request affairs node division in described subregion, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23; If not, the weighted value that then compares the database server node of all subregions among the S (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23;
The weighted value of the database server node of all subregions among step 27, the comparison P (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 24.
2. method according to claim 1, it is characterized in that, load equalizer is safeguarded a transactions requests formation for each database server, also affairs execution and the completion status of each database server are followed the tracks of simultaneously, if when monitoring conflict ratio value Thrashing in the database server greater than conflict critical value CR, then postpone the execution of next request transaction in this database server, described CR is a real number
Load equalizer is monitored the conflict ratio value Thrashing in the database server, further includes:
Load equalizer reads the total S of current all office's holder locks respectively from the lock table of database server AllTotal Snz with unblock office holder lock;
Load equalizer calculates conflict ratio value Thrashing:
Figure FSB00001105056300021
3. method according to claim 2 is characterized in that, the preferred value of CR can be 1.3.
4. method according to claim 2 is characterized in that, when load equalizer distributes a request transaction to described database server, also includes:
Steps A, load equalizer judge that whether described conflict ratio value Thrashing is less than conflict critical value CR, if then continue step B; If not, then load equalizer tail of the queue that this request transaction is put into the transactions requests formation is waited for;
Whether the transactions requests formation that step B, load equalizer are judged as described database server maintenance is empty, if, then directly dispatching this request transaction carries out to database server, if not, then this request transaction is put into the tail of the queue of transactions requests formation, dispatched the request transaction that is in head of the queue of transactions requests formation simultaneously and carry out to database server.
5. method according to claim 2 is characterized in that, when load equalizer monitors database server when executing a request transaction, also includes:
Load equalizer judges that whether described conflict ratio value Thrashing is less than conflict critical value CR, if, then when the transactions requests formation of described database server was not sky, the request transaction that is in head of the queue of scheduling transactions requests formation was carried out to database server; If not, then load equalizer is not dispatched request transaction in the transactions requests formation.
6. the load balancing device of a data base cluster system is characterized in that, includes:
Load equalizer, connect client and database server, be used for receiving the concurrent transaction of client-requested, wherein the concurrent transaction of client-requested abbreviates request transaction as, and the affairs of carrying out of each database server and the conflict relationship between the request transaction are modeled as the non-directed graph with weighted value, adopt the split plot design of figure then, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, database server node weights value in each subregion reaches balanced area principle simultaneously, with all request transaction node division in corresponding subregion, at last according to the subregion result, the database server that the described request affairs are distributed in the same subregion is carried out
Wherein, adopt the split plot design of figure, described non-directed graph is divided into k subregion, k is all database server node sums, what wherein each database server node was unique belongs in the different subregions, and according to the weighted value summation minimum on the limit of crossing over different subregions, the database server node weights value in each subregion reaches balanced area principle simultaneously, all request transaction node division in corresponding subregion, are further included:
Step 21, the total weights W of computing node TotalWith database server load balancing weights W Average, wherein, W TotalBe the weighted value sum of all nodes in the non-directed graph,
Figure FSB00001105056300032
Expression is to rounding on the χ;
Step 22, the subregion S set (t) that setting can be divided and the subregion set P (t) that has divided, and to S (t), P (t) difference initialization: S (t)={ S 1, S 2..., S k, S wherein 1, S 2..., S kRepresent K subregion, each the database server node during initialization in the non-directed graph is divided in the different subregions of S (t), i.e. each database server node unique subregion that belongs among the S (t) behind subregion; P (t) is empty set;
Step 23, judge that whether the weighted value of the database server node that each section post among the S (t) comprises is greater than W one by one AverageIf the weighted value of database server node is greater than W Average, then from S (t), move to described subregion among the P (t);
Step 24, judge the request transaction node that whether is not divided into subregion in the non-directed graph in addition, if then continue step 25; If not, then this flow process finishes;
Step 25, extract a request transaction node that is not divided into subregion, judge that whether subregion number that S (t) comprises is greater than 0, if then continue step 26; If not, then continue step 27;
In step 26, the judgement non-directed graph, whether other nodes that link to each other with described request affairs node have the node that belongs to the subregion among the S (t), if, then from the subregion of S (t), find the subregion of a S (t) of the weighted value summation maximum on the limit that links to each other with described request affairs node, with described request affairs node division in described subregion, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23; If not, the weighted value that then compares the database server node of all subregions among the S (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 23;
The weighted value of the database server node of all subregions among step 27, the comparison P (t), with described request affairs node division in the subregion of the weighted value minimum of database server node, and the weighted value of the database server node in the described subregion is updated to the weighted value sum of former weighted value and described request affairs node, turn to step 24.
7. load balancing device according to claim 6 is characterized in that, described load equalizer further includes k transactions requests formation attending device, wherein:
Transactions requests formation attending device, be used for one of them database server is safeguarded a transactions requests formation, and simultaneously the affairs implementation in the described database server is followed the tracks of, if when monitoring conflict ratio value Thrashing in the database server greater than conflict critical value CR, then wait for the execution that continues next request transaction in this database server until Thrashing during less than CR again, wherein the conflict ratio value Thrashing in the database server: S All, Snz is respectively the sum of current all office's holder locks of reading from the lock table of database server and the sum of unblock office holder lock, described CR is a real number.
8. load balancing device according to claim 7 is characterized in that, the preferred value of CR can be 1.3.
CN 201110241232 2011-08-22 2011-08-22 Load balance realizing method of database cluster system and device Expired - Fee Related CN102299959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110241232 CN102299959B (en) 2011-08-22 2011-08-22 Load balance realizing method of database cluster system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110241232 CN102299959B (en) 2011-08-22 2011-08-22 Load balance realizing method of database cluster system and device

Publications (2)

Publication Number Publication Date
CN102299959A CN102299959A (en) 2011-12-28
CN102299959B true CN102299959B (en) 2013-08-14

Family

ID=45360129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110241232 Expired - Fee Related CN102299959B (en) 2011-08-22 2011-08-22 Load balance realizing method of database cluster system and device

Country Status (1)

Country Link
CN (1) CN102299959B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102810116B (en) * 2012-06-29 2015-01-07 安科智慧城市技术(中国)有限公司 Automatic routing and load balancing method and system based on database connection
CN103714098B (en) * 2012-09-29 2018-10-23 伊姆西公司 Method and system for carrying out subregion to database
CN103440290A (en) * 2013-08-16 2013-12-11 曙光信息产业股份有限公司 Big data loading system and method
CN104462435A (en) * 2014-12-15 2015-03-25 同方知网数字出版技术股份有限公司 Lateral extension method of distributed database
US10079877B2 (en) * 2016-02-04 2018-09-18 Citrix Systems, Inc. System and method for cloud aware application delivery controller
CN105787006A (en) * 2016-02-22 2016-07-20 无锡中科富农物联科技有限公司 Load balancing system for database servers
CN107229648A (en) * 2016-03-25 2017-10-03 华为技术有限公司 A kind of method for processing resource and device
GB201707296D0 (en) * 2017-05-08 2017-06-21 Nchain Holdings Ltd Computer-implemented system and method
CN109117423B (en) * 2017-06-23 2022-05-03 阿里巴巴集团控股有限公司 Table partition configuration method, device and system of database system
CN110019528A (en) * 2017-12-26 2019-07-16 中国移动通信集团湖北有限公司 Database manipulation load-balancing method, device, equipment and medium
CN109981696B (en) * 2017-12-27 2021-11-30 阿里巴巴集团控股有限公司 Load balancing method, device and equipment
CN108255613B (en) * 2018-02-07 2021-01-01 北京航空航天大学 SOA system resource management method based on graph coloring
CN109491797A (en) * 2018-11-26 2019-03-19 深圳市斯博科技有限公司 Date storage method, system and computer readable storage medium
CN110515707B (en) * 2019-08-22 2022-02-25 上海交通大学 Deterministic concurrency control method and system based on advanced transaction processing
CN112953985B (en) * 2019-12-10 2023-04-07 贵州白山云科技股份有限公司 Request data processing method, device, medium and system
CN111986816B (en) * 2020-08-31 2022-11-29 深圳平安医疗健康科技服务有限公司 Outpatient case grouping method and device based on big data analysis
CN113535742B (en) * 2021-06-21 2022-10-28 华东师范大学 Partition-based concurrency control method under multi-master cloud database scene

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009130662A1 (en) * 2008-04-22 2009-10-29 Tubitak-Turkiye Bilimsel Ve Teknolojik Arastirma Kurumu Reduction of the time period necessary for comparison in criminal databases by using a universal set formation method where the universal set is subject to time-varying subset formation
CN101944045A (en) * 2010-10-18 2011-01-12 中国人民解放军国防科学技术大学 Method for distributing parallel discrete event simulation objects based on community characteristics

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009130662A1 (en) * 2008-04-22 2009-10-29 Tubitak-Turkiye Bilimsel Ve Teknolojik Arastirma Kurumu Reduction of the time period necessary for comparison in criminal databases by using a universal set formation method where the universal set is subject to time-varying subset formation
CN101944045A (en) * 2010-10-18 2011-01-12 中国人民解放军国防科学技术大学 Method for distributing parallel discrete event simulation objects based on community characteristics

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Bolin Ding et al.Finding Top-k Min-Cost Connected Trees in Databases.《Data Engineering》.2007,
Finding Top-k Min-Cost Connected Trees in Databases;Bolin Ding et al;《Data Engineering》;20071231;全文 *

Also Published As

Publication number Publication date
CN102299959A (en) 2011-12-28

Similar Documents

Publication Publication Date Title
CN102299959B (en) Load balance realizing method of database cluster system and device
CN101004743B (en) Distribution type file conversion system and method
CN104079630A (en) Business server side load balancing method, client side, server side and system
CN101951411A (en) Cloud scheduling system and method and multistage cloud scheduling system
CN102945175A (en) Terminal software online upgrading system and method based on cloud computing environment
CN103401947A (en) Method and device for allocating tasks to multiple servers
CN104104973A (en) Group bandwidth management optimization method applied to cloud media system
CN104735095A (en) Method and device for job scheduling of cloud computing platform
CN102394929A (en) Conversation-oriented cloud computing load balancing system and method therefor
CN105491150A (en) Load balance processing method based on time sequence and system
CN104052677B (en) The soft load-balancing method and device of data mapping
CN104202386B (en) A kind of high concurrent amount distributed file system and its secondary load equalization methods
Wen et al. Load balancing job assignment for cluster-based cloud computing
CN106412030B (en) A kind of selection storage resource method, apparatus and system
WO2021120633A1 (en) Load balancing method and related device
CN101771703A (en) Information service system and method
CN104283963A (en) Distributed and collaborative type CDN load balancing method
CN107197039B (en) A kind of PAAS platform service packet distribution method and system based on CDN
CN102480502A (en) I/O load equilibrium method and I/O server
CN105872082B (en) Fine granularity resource response system based on container cluster load-balancing algorithm
CN109729113A (en) Manage method, server system and the computer program product of dedicated processes resource
Kadhim et al. Hybrid load-balancing algorithm for distributed fog computing in internet of things environment
KR100989490B1 (en) Sysem and its method for load distribution between servers
Wen et al. Load balancing consideration of both transmission and process responding time for multi-task assignment
CN111107135B (en) Container mirror image parallel distribution method, scheduler and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130814

Termination date: 20150822

EXPY Termination of patent right or utility model