CN103023938B - A kind of service capability control method of server cluster and system - Google Patents

A kind of service capability control method of server cluster and system Download PDF

Info

Publication number
CN103023938B
CN103023938B CN201110288537.9A CN201110288537A CN103023938B CN 103023938 B CN103023938 B CN 103023938B CN 201110288537 A CN201110288537 A CN 201110288537A CN 103023938 B CN103023938 B CN 103023938B
Authority
CN
China
Prior art keywords
service
server
status information
request
inquiry
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.)
Active
Application number
CN201110288537.9A
Other languages
Chinese (zh)
Other versions
CN103023938A (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.)
Alibaba Cloud Computing 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 CN201110288537.9A priority Critical patent/CN103023938B/en
Publication of CN103023938A publication Critical patent/CN103023938A/en
Priority to HK13106292.7A priority patent/HK1178712A1/en
Application granted granted Critical
Publication of CN103023938B publication Critical patent/CN103023938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

This application provides a kind of service capability control method of server cluster, comprising: the service status information of server in monitoring cluster, and judge whether described service status information exceedes predetermined threshold value; If, then determine according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed; According to described number of servers of distributing in rear service request, according to the destination server of respective numbers in presetting rule determination cluster; The service request of reception is distributed to described destination server.The application can tackle the burst flow exceeding service ability fast, and guarantees that service is not interrupted.

Description

A kind of service capability control method of server cluster and system
Technical field
The application relates to the technical field of server cluster, particularly relates to a kind of service capability control method and system of server cluster.
Background technology
At present, all kinds of large enterprise, large-scale website all adopt server cluster to carry out resource management.So-called server cluster, just referring to multiple servers to put together and carry out same service, similarly is only have a server in client.Cluster can utilize multiple computer to carry out parallel computation thus obtain very high computational speed, and also can backup with multiple computer, even if one of them machine breaks down, whole search server cluster still can normally run.
Each server cluster has oneself the service limit, when facing the flow exceeding oneself service ability, can cause search server cluster entering part can not service state, even completely can not service state.Such as, search server cluster resource exhausts, all can not complete causing all requests or all time-out; , search server cluster is forced to random or abandons component requests according to priority.But, in the application of some large-scale websites, especially at some consumer to consumer (Customer-to-Customer, in the e-commerce website of C2C) pattern, because commodity amount is huge, number of users is numerous, in the process of commercial articles searching, during in the face of exceeding the burst flow of service ability, if there is service disruption suddenly, Consumer's Experience will be had a strong impact on.
In prior art, for when exceeding the burst flow of service ability, generally adopt the mode abandoning component requests, be specially random drop request, or progressively abandon unessential request according to source, query pattern according to the priority of configuration, guarantee important request as far as possible.But this mode always can cause the part of service unavailable.
It is add server in the cluster that the another kind of prior art tackles the mode exceeding the burst flow of service ability, but the shortcoming of this mode reacts slow, especially because in general the flow that burst exceedes service ability is improper growth, when adding machine, the preparation of machine and the synchronous of data all need the time, search server cluster entering part during this period of time may be caused to serve disabled state, and, also manpower intervention is needed in machine adding procedure, intelligence not, response lag, the flow spike of burst can not be tackled fast.
Therefore, the technical problem needing those skilled in the art urgently to solve at present is exactly: the service ability controlling mechanism proposing a kind of server cluster, in order to tackle the burst flow exceeding service ability fast, and guarantees that service is not interrupted.
Summary of the invention
Technical problems to be solved in this application are, provide a kind of service capability control method and system of server cluster, in order to tackle the burst flow exceeding service ability fast, and guarantee that service is not interrupted.
In order to solve the problem, this application discloses a kind of service capability control method of server cluster, comprising:
The service status information of server in monitoring cluster, and judge whether described service status information exceedes predetermined threshold value;
If, then determine according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed;
According to described number of servers of distributing in rear service request, according to the destination server of respective numbers in presetting rule determination cluster;
The service request of reception is distributed to described destination server.
Preferably, described cluster comprises the server Merger of distribution inquiry request/Fusion query result, and, the server S earcher of inquiry service is provided, wherein, the described server S earcher of inquiry service that provides adopts determinant distribution, and a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N > 1 and be integer.
Preferably, described service status information is at least one in following state information:
Task queue in the server S earcher of inquiry service length is provided;
Cpu load in the server S earcher of inquiry service situation is provided;
The average time of a server S earcher process service request of inquiry service is provided.
Preferably, the service status information of server in described monitoring cluster, and judge that the step whether described service status information exceedes predetermined threshold value comprises:
Each provides the server S earcher timing of inquiry service or reports the service status information of himself in real time;
Gather described each and the server S earcher of the inquiry service service status information of reporting is provided, according to the service status information after gathering, described in judgement, whether exceed predetermined threshold value.
Preferably, described when service status information exceedes predetermined threshold value, determine that the step of the number of servers that posterior service request is distributed comprises according to service status information:
When service status information exceedes predetermined threshold value, determine corresponding service degradation rank according to service status information;
The number of servers that posterior service request is distributed is determined according to described service degradation rank.
Preferably, described service degradation rank comprises multiple rank, and each service degradation rank has corresponding server distribution quantity information respectively;
Described when service status information exceedes predetermined threshold value, determine that the step of corresponding service degradation rank comprises according to service status information:
When the service status information that server is current in the cluster exceedes first span of predetermined threshold value, determine that corresponding service degradation rank is first service degradation rank, described first service degradation rank has corresponding first server distribution quantity information;
When the service status information that server is current in the cluster exceedes second span of predetermined threshold value, determine that corresponding service degradation rank is second service degradation rank, described second service degradation rank has corresponding second server distribution quantity information; The rest may be inferred.
Preferably, the described number of servers according to distributing in rear service request, comprises according to the step of the destination server of respective numbers in presetting rule determination cluster:
The service degradation rank notice determined is distributed the server Merger of inquiry request/Fusion query result;
The server Merger of described distribution inquiry request/Fusion query result removes designated parameter after receiving the service request that user submits to from described request;
The server distribution quantity information corresponding according to described service degradation rank, and, remove the service request after designated parameter, determine that the destination server Searcher on fixing row removes.
Preferably, describedly N number ofly provide the index data on the server S earcher of inquiry service the same, be referred to as 1 row; A complete index data is arranged by M and forms, and is referred to as 1 row; Wherein, M > 1 and be integer,
In the described number of servers according to distributing in rear service request, before the service request of reception being distributed to the step on the server of respective numbers in cluster, described method also comprises:
If the service status information of server in cluster, do not exceed predetermined threshold value, then distribute the server Merger of inquiry request/Fusion query result when receiving service request, the server S earcher that one provides inquiry service is extracted in often arranging, M platform is altogether selected to provide the server S earcher of inquiry service, as the number of servers that service request when not exceeding predetermined threshold value is distributed.
Preferably, described method, also comprises:
Perform search operation by the corresponding server S earcher of inquiry service that provides, and Search Results is returned to the server Merger of distribution inquiry request/Fusion query result;
Arrange described Search Results by the server Merger of described distribution inquiry request/Fusion query result, and the Search Results after arranging is returned to user.
Preferably, before the step according to the number of servers of distributing in rear service request, also comprise:
When in cluster, the service status information of server returns in preset threshold range, determine according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is greater than the number of servers that when described service status information exceedes predetermined threshold value, service request is distributed.
The embodiment of the present application also discloses a kind of service ability control system of server cluster, comprising:
Monitoring module, for monitoring the service status information of server in cluster, and judges whether described service status information exceedes predetermined threshold value; If so, service degradation processing module is then called;
Service degradation processing module, for determining according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed;
Data selecting module, for according to described number of servers of distributing in rear service request, according to the destination server of respective numbers in presetting rule determination cluster;
Requests routing module, for being distributed to described destination server by the service request of reception.
Preferably, described cluster comprises the server Merger of distribution inquiry request/Fusion query result, and, the server S earcher of inquiry service is provided, wherein, the described server S earcher of inquiry service that provides adopts determinant distribution, and a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N > 1 and be integer;
Described monitoring module is arranged on to be provided in the server S earcher of inquiry service, and described data selecting module and Requests routing module installation are in the server Merger of distribution inquiry request/Fusion query result, and described service degradation processing module is independently arranged.
Compared with prior art, the application comprises following advantage:
By monitoring search server clustering capability index in search service cluster, faced by exceed the burst flow of service ability time adaptively search service is demoted, namely the mode dynamically reducing search data collection promotes service ability rapidly, do not interrupt with the integrality exchange for service of sacrificing data, can fast quick-recovery search server cluster service rank when flow recovers normal.The application does not need manpower intervention for the burst flow of short-term, and in the service degradation process of intelligence, fast lifting service ability guarantees not interrupting of service.
Accompanying drawing explanation
Fig. 1 is the flow chart of steps of the service capability control method embodiment of a kind of server cluster of the application;
Fig. 2 is the structured flowchart of the service ability control system embodiment of a kind of server cluster of the application.
Embodiment
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
At present, search engine is by supporting text query fast to needing the text of inquiry to set up inverted index (invertedindex).Inverted index comes from practical application needs the value according to attribute to search record.Each in this concordance list all comprises a property value and has the address of each record of this property value.Owing to not being determine property value by recording, but being determined the position of recording by property value, being thus called inverted index.
For the commercial articles searching at certain electronic business web site, by setting up inverted index to the title of commodity, the querying flow carrying out commodity is as follows:
Step S1, the searching keyword receiving user side input and other querying conditions, as conditions such as filtration, statistics, sequences;
Step S2, searching keyword is carried out participle, each word inquiry inverted list then after participle, and set operation is carried out to the inverted list of these words and position relationship calculates, obtain the final goods list of this searching keyword;
Step S3, other computings are carried out to the commodity satisfied condition after return to user side.
Large-scale search aggregated structure adopts the mode of multiple lines and multiple rows to provide extensive high concurrent search service usually; Large-scale search cluster number of files is very large, and after building storehouse, index quantity is also very large, and usually need to be divided into many parts, be placed in multiple stage searching machine (Searcher), namely this n platform machine forms complete a index.Further, because the user carrying out searching for is huge simultaneously, a machine cannot provide high so concurrent search service, so need jointly to provide service by m the Searcher with same index.
In practice, the machine with same index is referred to as 1 row (col), altogether n row; A complete index is arranged by n and forms, and be referred to as 1 row (row), m is capable altogether; The i.e. framework of multiple lines and multiple rows.
Generally speaking, to carry out the basic process of search inquiry as follows for large-scale website:
1, after a searching request (query) arrives the server (Merger) of dispense request/Fusion query result, from every row search server (Searcher), random selecting 1 (in practice, the probability that in 1 row, every platform is selected is substantially identical, to realize load balancing), and query is sent to these Searcher;
2, after every platform Searcher receives searching request query, searching keyword is carried out participle, then each root (token) after participle is utilized to inquire about its inverted list, and set operation and position relationship calculating are carried out to the inverted list of these token, obtain the final Search Results doclist of this searching keyword; Doclist and other querying condition are done set operation, after then carrying out some statistics and sequence rank, result is returned to Merger;
3, after Merger receives returning results of every platform Searcher, gather, then result is returned user side.
In large-scale search server cluster determinant framework, columns is determined by total data amount/unit supported data amount.Line number is determined by search server clustering design service ability/single file service ability.
Faced by exceed the flow of design service ability time, be the availability ensureing search server cluster, according to the mode abandoning component requests in prior art, as described in the background section, the part that this kind of mode always can cause serving is unavailable.Or, the mode of adding server is in the cluster adopted to tackle the burst flow exceeding service ability, but the shortcoming of this mode reacts slow, especially when the burst flow exceeding service ability is improper growth, when adding machine, a line must be added, but because the preparation of machine and the synchronous of data all need the time, search server cluster entering part during this period of time may be caused to serve disabled state, and, also manpower intervention is needed in machine adding procedure, intelligence not, so, this mode can not tackle the flow spike of burst fast.
For the problems referred to above, the core idea that inventor herein creatively proposes the application is, by monitoring search server clustering capability index in search service cluster, faced by exceed the burst flow of service ability time, adaptively to search service degradation, the mode namely dynamically reducing search data collection promotes service ability rapidly, does not interrupt with the integrality exchange for service of sacrificing data, when flow recovers normal, can fast quick-recovery search server cluster service rank.The application does not need manpower intervention for the burst flow of short-term, and in the service degradation process of intelligence, fast lifting service ability guarantees not interrupting of service.
With reference to Fig. 1, it illustrates the flow chart of steps of the service capability control method embodiment of a kind of server cluster of the application, specifically can comprise the following steps:
The service status information of server in step 101, monitoring cluster, and judge whether described service status information exceedes predetermined threshold value; If so, then step 102 is performed;
To apply the embodiment of the present application in search server cluster, if this specification is above as described in relevant portion, the server Merger of distribution inquiry request/Fusion query result can be comprised in described cluster, and, the server S earcher of inquiry service is provided, wherein, the described server S earcher of inquiry service that provides adopts determinant distribution, a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N > 1 and be integer.In specific implementation, in described cluster, the service status information of server can be the task queue length in Searcher, the cpu load situation in Searcher, and/or, the average time of a Searcher process service request.
Wherein, the task queue length in Searcher and the cpu load situation in Searcher, can pass through interface routine read operation search server cluster current state, or adopt the monitoring software of increasing income to obtain this type of service status information.The average time of a Searcher process service request by embedding statistics codes in a program, operationally can carve dynamic calculation and obtaining.
Certainly, the obtain manner of above-mentioned service status information is only used as example, and those skilled in the art adopt other service status information to be also feasible as monitored object according to actual conditions, the application to this without the need to being limited.
As a kind of example of the embodiment of the present application embody rule, described step 101 specifically can comprise following sub-step:
Sub-step S11, each the server S earcher timing that inquiry service is provided or the service status information of reporting himself in real time;
Sub-step S12, gather described each the server S earcher of the inquiry service service status information of reporting is provided, according to the service status information after gathering, judge whether to exceed predetermined threshold value.
Described predetermined threshold value can be arranged arbitrarily according to actual conditions by those skilled in the art.To monitor the task queue length in Searcher, under online, a rational length value experimentally can be determined, such as 110, be the theoretical upper limit of service ability.The configuration of line upper threshold value is generally slightly less than this theoretical upper limit, such as 100.When being 50 when reporting task queue length, then can think safe, search server cluster surplus can task be simply (100-50)/50=100%.When the task queue length reported is more than 100, can thinks and exceed threshold value.
Such as, when cluster runs, each Searcher checked himself task queue length respectively before each service, and by UDP (UserDatagramProtocol, User Datagram Protocol) network communication bag reports the information of task queue length, by gathering the task queue length of each Searcher, and the task queue length gathering rear each Searcher is contrasted with the threshold value of the service ability limit preset, if the threshold value presetting the task queue limitation of length of each Searcher is 100, the task queue length of the current Searcher of existing 90% exceedes this threshold value, then judge to need to perform next step, or if the threshold value of the task queue limitation of length of all Searcher is 10000, the task queue length gathering all Searcher is 10500, so judge to need to perform next step.
Certainly, the above-mentioned method judging whether service status information exceedes predetermined threshold value is only used as example, and in practice, it is all feasible that those skilled in the art arrange any one determination methods, and the application is not restricted this.Such as, the threshold value presetting the task queue limitation of length of each Searcher is 100, calculates the average task queue length of current each Searcher, if exceed this threshold value, then judges to need to perform next step.
Step 102, according to described service status information, determine the number of servers that posterior service request is distributed;
Wherein, described number of servers of distributing in rear service request is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed.
This step be used for faced by exceed the burst flow of service ability time, adaptively search service is demoted.In a preferred embodiment of the present application, this step specifically can comprise following sub-step:
Sub-step S21, when service status information exceedes predetermined threshold value, determine corresponding service degradation rank according to service status information;
In specific implementation, described service degradation rank can comprise multiple rank, and each service degradation rank has corresponding server distribution quantity information respectively; In this case, described sub-step S21 specifically can operate as follows:
When the service status information that server is current in the cluster exceedes first span of predetermined threshold value, determine that corresponding service degradation rank is first service degradation rank, described first service degradation rank has corresponding first server distribution quantity information;
When the service status information that server is current in the cluster exceedes second span of predetermined threshold value, determine that corresponding service degradation rank is second service degradation rank, described second service degradation rank has corresponding second server distribution quantity information;
The rest may be inferred.
Sub-step S22, according to described service degradation rank, determine the number of servers that posterior service request is distributed.
Further, for the burst flow adapting to exceed in reality service ability returns back to the situation of normal discharge, search service ability can also be recovered adaptively by following steps in the embodiment of the present application:
When in cluster, the service status information of server returns in preset threshold range, determine according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is greater than the number of servers that when described service status information exceedes predetermined threshold value, service request is distributed.
Such as, according to the state that Searcher reports, select a service degradation rank, such as M/2, notify each Merger with the mechanism of internet message; Merger receives the search inquiry request of user, selects M/2 platform machine, often row one, sends user's inquiry request to M/2 platform Searcher.
In actual applications, the service ability under degraded service can be calculated by following formula:
The service ability of single file Searcher is P, and the line number of search server cluster is N, a line Searcher quantity is M, then total service ability of search server cluster is P*N.
When service degradation, if Merger only sends a service request to M/2 Searcher, then the service ability of single file Searcher is promoted to 2P, and total service ability of search server cluster is 2P*N.
In a preferred embodiment of the present application, the quantity of the Searcher that a service request (being inquiry request in the application of search server cluster) sends, be defined as service degradation rank, then the range of choice of service degradation rank is [M, 1], accordingly, total service ability scope of search server cluster is [P*N, P*M*N].In this case, the service ability computing formula under a certain rank Q is:
Service ability Q=P*N*M/Q.
In practice, initial service degradation rank can be calculated in the following way:
As previously mentioned, by monitoring Searcher representing the index of current service level, as the length of task queue, by a large amount of test, obtain the acceptable maximum A of this index under normal service, judge cluster service capability state after gathering index that each Searcher reports, if 90% machine index is more than A, (threshold value can be determined according to actual needs, here 90% is got just in order to algorithm is described), then start degraded service.The selection of initial degradation rank according to the mean value a of current server index and can expect that the index (be generally slightly less than A, can get 0.9A here) returned to calculates.
I.e. rank L=Floor (0.9AM/a), wherein, Floor is general floor function.
Next, can dynamic conditioning service degradation rank in the following way further:
After obtaining initial service degradation rank, part Searcher is selected to send according to degradation rank each inquiry request.Now, the total service ability of search server cluster starts to promote, and considers flow also in continuous change, so continue the upper index of reporting of monitoring Searcher, constantly service adjustment is demoted rank.Principle is the integrality ensureing data under guaranteeing to serve unbroken prerequisite as far as possible.
More specifically, if index continues to worsen, then similar initial service degradation level selection algorithm is adopted to continue to demote to service.Such as, now expect that the index returned to can get 0.9 of desired value last time;
If index is stabilized near predetermined threshold value, then continues to observe, do not deal with;
If index returns in the scope of predetermined threshold value, then the mode adopting single step to promote rank progressively recovers data integrity.Need after each lifting to observe one-period, cycle time is determined by configuring, and generally can be chosen as a minute rank.
For the commercial articles searching in C2C website, if search server cluster configuration is 3 Merger, 5 row search, often row 10.It is 10 parts that 1 part of complete commodity data is divided equally according to commodity id.5 the Searcher machines often arranged load same data, the data that a line 10 machine compositions are a complete.
Search server cluster monitoring index is the task queue length on search, and by great many of experiments under line, determine that task queue length less than 100 is for normal condition, more than 100, rear i.e. search server cluster is absorbed in and partly can not serves.
When search server cluster runs, Searcher, before each service, is checked the length of task queue, and is reported by UDP network communication bag.If the task queue length of reporting at present is 200, then service degradation rank is 5, and namely original each request needs to issue 10 Searcher, and only need now to issue 5 Searcher, the service ability of search server cluster promotes one times.
By control command, service degradation rank is sent to Merger machine, Merger asks to start degraded service to user below, and namely each request only sends 5 Searcher machines.Now there are 3 kinds of possibilities:
The first, flow continues to increase, and the task queue length that Searcher reports continues to maintain more than 100, needs to strengthen service degradation dynamics, dynamic conditioning service degradation rank, specifically can adopt similar initial service degradation level selection algorithm to continue to demote to service.
The second, stability of flow, maintains service degradation dynamics.
The third, flow gradually reduces, and the task queue length that Searcher reports reduces, then progressively Resume service rank, and now, master control search server cluster sent control command to Merger every 1 minute, and service class progressively rises to 10 from 6.
Step 103, according to described number of servers of distributing in rear service request, according to the destination server of respective numbers in presetting rule determination cluster;
In a preferred embodiment of the present application, described step 103 specifically can comprise following sub-step:
Sub-step S31, the service degradation rank notice Merger that will determine;
Sub-step S32, Merger remove designated parameter after receiving the service request of user's submission from described request;
In practice, described designated parameter for affect the conforming parameter of search result data, such as page turning relevant parameter.
Sub-step S33, the server distribution quantity information corresponding according to described service degradation rank, and, remove the service request after designated parameter, determine the destination server Searcher on fixing row.
In order to ensure the consistency of same requesting query result, and in user's page turning situation the order of Search Results, preferably, the embodiment of the present application sends not in accordance with the service degradation rank Stochastic choice part Searcher of search server cluster; But ensure conforming parameter (as page turning relevant parameter etc.) by affecting data in removal inquiry request, select the Searcher of fixing row to send request according to search server cluster degradation rank.Such as, server cluster is 8 row, and current service is downgraded to 4 row, and namely an inquiry request needs to be sent to 4 row servers, then, after removing designated parameter, same queries condition selects 4 identical row servers.
Or as, what user returned when seeing first page according to price sequence is the merchandise news of 10 pieces to 40 pieces, if after page turning, send this request to on the different searcher of first page, the merchandise news that may have 20 pieces that Search Results returns, at this moment data just there will be inconsistent phenomenon, and after namely the merchandise news of 20 pieces appears at the merchandise news of 40 pieces, this is not inconsistent with the price sort criteria of setting.Now, by removing the parameter (as page turning relevant parameter etc.) affecting data consistency in inquiry request, and select the Searcher of fixing row to send request, the first page that even user checks is the Search Results on the 1st, 3,5 row 3 searcher, and the second page that so user checks also must be Search Results on the 1st, 3,5 row 3 searcher.
As a kind of example of the present embodiment embody rule, suppose that current service degradation rank is 5, namely corresponding server distribution quantity is 5, namely in 10 Searcher, 5 are extracted, now have 252 kinds of permutation and combination, certainly in practice, those skilled in the art also can choose some wherein conventional permutation and combination according to actual conditions, as got 50 kinds of conventional permutation and combination, and be that often kind of permutation and combination distributes corresponding sequence number, after receiving inquiry request, remove the page turning relevant parameter in request, Hash operation (Hash) is carried out to the request after removing this parameter, obtain a numeral, the Searcher of the fixing row comprised according to the permutation and combination of the corresponding sequence number of this digital extraction, be such as 1, 3, 5, 7, the Searcher of 9 row, as target Searcher, in subsequent step, the service request of reception can be distributed to described target Searcher.
Step 104, the service request of reception is distributed to described destination server.
In specific implementation, if the service status information of server in cluster, do not exceed predetermined threshold value, then can by Merger when receiving service request, the server S earcher that one provides inquiry service is extracted in often arranging, altogether select M platform to provide the server S earcher of inquiry service, described M is the number of servers that service request when not exceeding predetermined threshold value is distributed, and the service request of reception is distributed on described M platform Searcher.
In the application of concrete search server cluster, described Searcher performs search operation, and Search Results is returned to Merger; Then arrange described Search Results by Merger, and the Search Results after arranging is returned to user.
It should be noted that, for embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the application is not by the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and involved action and module might not be that the application is necessary.
With reference to figure 2, show the structured flowchart of the service ability control system embodiment of a kind of server cluster of the application, specifically can comprise with lower module:
Monitoring module 201, for monitoring the service status information of server in cluster, and judges whether described service status information exceedes predetermined threshold value; If so, service degradation processing module 202 is then called;
Service degradation processing module 202, for determining according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed;
Data selecting module 203, for according to described number of servers of distributing in rear service request, according to the destination server of respective numbers in presetting rule determination cluster;
Requests routing module 204, for being distributed to described destination server by the service request of reception.
To apply the embodiment of the present application in search server cluster, if this specification is above as described in relevant portion, the server Merger of distribution inquiry request/Fusion query result can be comprised in described cluster, and, the server S earcher of inquiry service is provided, wherein, the described server S earcher of inquiry service that provides adopts determinant distribution, a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N > 1 and be integer.
As shown in Figure 2, in specific implementation, described monitoring module can be arranged in Searcher, and described data selecting module and Requests routing module can be arranged in Merger, and described service degradation processing module can independently be arranged.
As the example of the embodiment of the present application embody rule, in described cluster, the service status information of server can for providing the length of the task queue in the server S earcher of inquiry service, cpu load in the server S earcher of inquiry service situation is provided, and/or, the average time of a server S earcher process service request of inquiry service is provided.
In a preferred embodiment of the present application, described monitoring module 201 specifically can comprise with lower module:
Report submodule, for providing the server S earcher timing of inquiry service by each or report the service status information of himself in real time;
Gathering submodule, providing the server S earcher of the inquiry service service status information of reporting for gathering described each;
Judge submodule, whether the service status information after gathering for basis, exceed predetermined threshold value described in judgement.
In a preferred embodiment of the present application, described service degradation processing module 202 specifically can comprise following submodule:
Reduce rank determination submodule, for when service status information exceedes predetermined threshold value, determine corresponding service degradation rank according to service status information;
Number of servers adjustment submodule, for determining according to described service degradation rank the number of servers that posterior service request is distributed.
One as the present embodiment embody rule is saved somebody's life, and described service degradation rank can comprise multiple rank, and each service degradation rank has corresponding server distribution quantity information respectively;
Reduce rank determination submodule and can determine corresponding service degradation rank according to service status information as follows:
When the service status information that server is current in the cluster exceedes first span of predetermined threshold value, determine that corresponding service degradation rank is first service degradation rank, described first service degradation rank has corresponding first server distribution quantity information;
When the service status information that server is current in the cluster exceedes second span of predetermined threshold value, determine that corresponding service degradation rank is second service degradation rank, described second service degradation rank has corresponding second server distribution quantity information;
The rest may be inferred.
In a preferred embodiment of the present application, described data selecting module 203 specifically can comprise following submodule:
Notice submodule, the service degradation rank notice for determining distributes the server Merger of inquiry request/Fusion query result;
Parameter remove submodule, for received by the server Merger of described distribution inquiry request/Fusion query result user submit to service request after, from described request, remove designated parameter;
Destination server determination submodule, for the server distribution quantity information corresponding according to described service degradation rank, and, remove the service request after designated parameter, determine the destination server Searcher on fixing row.
In specific implementation, described system embodiment can also comprise with lower module:
Normal process module, for the service status information of server in the cluster, when not exceeding predetermined threshold value, the server Merger of distribution inquiry request/Fusion query result is when receiving service request, the server S earcher that one provides inquiry service is extracted in often arranging, M platform is altogether selected to provide the server S earcher of inquiry service, as the number of servers that service request when not exceeding predetermined threshold value is distributed.
In the application of search service, described system embodiment can also comprise with lower module:
Search module, for performing search operation by the corresponding server S earcher of inquiry service that provides, and returns to the server Merger of distribution inquiry request/Fusion query result by Search Results;
Result returns module, for arranging described Search Results by the server Merger of described distribution inquiry request/Fusion query result, and the Search Results after arranging is returned to user.
For the burst flow adapting to exceed in reality service ability returns back to the situation of normal discharge, native system embodiment can also comprise with lower module:
Ability Recovery processing module, when service status information for server in the cluster returns in preset threshold range, determine according to described service status information the number of servers that posterior service request is distributed, described number of servers of distributing in rear service request is greater than the number of servers that when described service status information exceedes predetermined threshold value, service request is distributed.
For system embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
The application can be used in numerous general or special purpose computing system environment or configuration.Such as: personal computer, server computer, handheld device or portable set, laptop device, multicomputer system, system, set top box, programmable consumer-elcetronics devices, network PC, minicom, mainframe computer, the distributed computing environment (DCE) comprising above any system or equipment etc. based on microprocessor.
The application can describe in the general context of computer executable instructions, such as program module.Usually, program module comprises the routine, program, object, assembly, data structure etc. that perform particular task or realize particular abstract data type.Also can put into practice the application in a distributed computing environment, in these distributed computing environment (DCE), be executed the task by the remote processing devices be connected by communication network.In a distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium comprising memory device.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not having more restrictions, the key element limited by statement " comprising ... ", does not remove and also there is other identical element in the process comprising described key element, method, article or equipment.
Above the service capability control method of a kind of server cluster that the application provides and a kind of service ability control system of server cluster are described in detail, apply specific case herein to set forth the principle of the application and execution mode, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (11)

1. a service capability control method for server cluster, is characterized in that, comprising:
The service status information of server in monitoring cluster, and judge whether described service status information exceedes predetermined threshold value;
If, then determine according to described service status information the number of servers that each posterior service request is distributed, when described service status information exceedes predetermined threshold value, the described number of servers determining that each posterior service request is distributed comprises: the service degradation corresponding to each posterior service request; The number of servers that each posterior service request described is distributed is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed;
According to the number of servers that service request posterior described in each is distributed, according to the destination server of respective numbers in presetting rule determination cluster;
The service request of reception is distributed to described destination server.
2. method according to claim 1, it is characterized in that, described cluster comprises the server Merger of distribution inquiry request/Fusion query result, and, the server S earcher of inquiry service is provided, wherein, described in provide inquiry service server S earcher adopt determinant distribution, a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N>1 and be integer.
3. method according to claim 2, is characterized in that, described service status information is at least one in following state information:
Task queue in the server S earcher of inquiry service length is provided;
Cpu load in the server S earcher of inquiry service situation is provided;
The average time of a server S earcher process service request of inquiry service is provided.
4. method according to claim 3, is characterized in that, the service status information of server in described monitoring cluster, and judges that the step whether described service status information exceedes predetermined threshold value comprises:
Each provides the server S earcher timing of inquiry service or reports the service status information of himself in real time;
Gather described each and the server S earcher of the inquiry service service status information of reporting is provided, according to the service status information after gathering, described in judgement, whether exceed predetermined threshold value.
5. method according to claim 1, is characterized in that, described service degradation rank comprises multiple rank, and each service degradation rank has corresponding server distribution quantity information respectively;
Described when service status information exceedes predetermined threshold value, determine that the step of corresponding service degradation rank comprises according to service status information:
When the service status information that server is current in the cluster exceedes first span of predetermined threshold value, determine that corresponding service degradation rank is first service degradation rank, described first service degradation rank has corresponding first server distribution quantity information;
When the service status information that server is current in the cluster exceedes second span of predetermined threshold value, determine that corresponding service degradation rank is second service degradation rank, described second service degradation rank has corresponding second server distribution quantity information; The rest may be inferred.
6. method according to claim 5, is characterized in that, described number of servers of distributing according to each posterior service request, comprises according to the step of the destination server of respective numbers in presetting rule determination cluster:
The service degradation rank notice determined is distributed the server Merger of inquiry request/Fusion query result;
The server Merger of described distribution inquiry request/Fusion query result removes designated parameter after receiving the service request that user submits to from described request;
The server distribution quantity information corresponding according to described service degradation rank, and, remove the service request after designated parameter, determine that the destination server Searcher on fixing row removes.
7. method according to claim 2, is characterized in that, describedly N number ofly provides the index data on the server S earcher of inquiry service the same, is referred to as 1 row; A complete index data is arranged by M and forms, and is referred to as 1 row; Wherein, M>1 and be integer,
In described number of servers of distributing according to each posterior service request, before the service request of reception being distributed to the step on the server of respective numbers in cluster, described method also comprises:
If the service status information of server in cluster, do not exceed predetermined threshold value, then distribute the server Merger of inquiry request/Fusion query result when receiving service request, the server S earcher that one provides inquiry service is extracted in often arranging, M platform is altogether selected to provide the server S earcher of inquiry service, as the number of servers that service request when not exceeding predetermined threshold value is distributed.
8. method according to claim 7, is characterized in that, also comprises:
Perform search operation by the corresponding server S earcher of inquiry service that provides, and Search Results is returned to the server Merger of distribution inquiry request/Fusion query result;
Arrange described Search Results by the server Merger of described distribution inquiry request/Fusion query result, and the Search Results after arranging is returned to user.
9. the method according to claim 1 or 2 or 3 or 4, is characterized in that, before the step of the number of servers of distributing according to each posterior service request, also comprises:
When in cluster, the service status information of server returns in preset threshold range, determine according to described service status information the number of servers that each posterior service request is distributed, the number of servers that each posterior service request described is distributed is greater than the number of servers that when described service status information exceedes predetermined threshold value, service request is distributed.
10. a service ability control system for server cluster, is characterized in that, comprising:
Monitoring module, for monitoring the service status information of server in cluster, and judges whether described service status information exceedes predetermined threshold value; If so, service degradation processing module is then called;
Service degradation processing module, for determining the number of servers that each posterior service request is distributed according to described service status information, when described service status information exceedes predetermined threshold value, the described number of servers determining that each posterior service request is distributed comprises: the service degradation corresponding to each posterior service request; The number of servers that each posterior service request described is distributed is less than the number of servers that when described service status information does not exceed predetermined threshold value, service request is distributed;
Data selecting module, for the number of servers of distributing according to each posterior service request described, according to the destination server of respective numbers in presetting rule determination cluster;
Requests routing module, for being distributed to described destination server by the service request of reception.
11. systems according to claim 10, it is characterized in that, described cluster comprises the server Merger of distribution inquiry request/Fusion query result, and, the server S earcher of inquiry service is provided, wherein, described in provide inquiry service server S earcher adopt determinant distribution, a line M provides the data on the server S earcher of inquiry service to form a partial data, and row are N number of provides the data on the server S earcher of inquiry service to be consistent; Wherein, M, N>1 and be integer;
Described monitoring module is arranged on to be provided in the server S earcher of inquiry service, and described data selecting module and Requests routing module installation are in the server Merger of distribution inquiry request/Fusion query result, and described service degradation processing module is independently arranged.
CN201110288537.9A 2011-09-26 2011-09-26 A kind of service capability control method of server cluster and system Active CN103023938B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110288537.9A CN103023938B (en) 2011-09-26 2011-09-26 A kind of service capability control method of server cluster and system
HK13106292.7A HK1178712A1 (en) 2011-09-26 2013-05-28 Method and system for controlling service capability of a server cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110288537.9A CN103023938B (en) 2011-09-26 2011-09-26 A kind of service capability control method of server cluster and system

Publications (2)

Publication Number Publication Date
CN103023938A CN103023938A (en) 2013-04-03
CN103023938B true CN103023938B (en) 2015-11-25

Family

ID=47972066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110288537.9A Active CN103023938B (en) 2011-09-26 2011-09-26 A kind of service capability control method of server cluster and system

Country Status (2)

Country Link
CN (1) CN103023938B (en)
HK (1) HK1178712A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105656962A (en) * 2014-11-11 2016-06-08 阿里巴巴集团控股有限公司 Service calling method and device
CN105656855B (en) * 2014-11-14 2018-11-02 阿里巴巴集团控股有限公司 The control method and device that resource accesses
CN104993953B (en) * 2015-06-19 2019-02-26 北京奇虎科技有限公司 The method and apparatus for detecting network service state
CN106202581B (en) * 2016-08-30 2019-06-14 北京奇艺世纪科技有限公司 A kind of data search method and device
CN106339296A (en) * 2016-08-31 2017-01-18 虎扑(上海)文化传播股份有限公司 Method and device for monitoring service state
CN107040566B (en) * 2016-09-19 2020-01-31 阿里巴巴集团控股有限公司 Service processing method and device
CN108156208B (en) * 2016-12-02 2022-02-25 阿里巴巴集团控股有限公司 Method, device and system for publishing application program data
CN107196785A (en) * 2017-03-31 2017-09-22 北京奇艺世纪科技有限公司 The method and device that back-end services degrade automatically
CN107204875B (en) * 2017-05-11 2022-08-23 腾讯科技(深圳)有限公司 Data reporting link monitoring method and device, electronic equipment and storage medium
CN107317702A (en) * 2017-06-13 2017-11-03 广东神马搜索科技有限公司 The service class control method and system of online service system
CN107659431A (en) * 2017-08-15 2018-02-02 北京趣拿软件科技有限公司 Interface processing method, apparatus, storage medium and processor
CN110069337A (en) * 2018-01-24 2019-07-30 北京京东尚科信息技术有限公司 A kind of method and apparatus that disaster tolerance degrades
CN108510416A (en) * 2018-03-28 2018-09-07 南京红松信息技术有限公司 Examination flux monitoring system and implementation method
CN111385125B (en) * 2018-12-29 2022-05-03 Tcl科技集团股份有限公司 Server dynamic control method and server
CN109981459B (en) * 2019-02-28 2021-02-19 联想(北京)有限公司 Information sending method, client and computer readable storage medium
CN110134575B (en) * 2019-04-26 2022-11-22 厦门网宿有限公司 Method and device for calculating service capacity of server cluster
CN112988434B (en) * 2019-12-13 2024-05-03 中国银联股份有限公司 Service fuse, service fusing method and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753534A (en) * 2008-12-10 2010-06-23 徐文祥 Zoning adaptive network system based on cluster server and building method
CN102130938A (en) * 2010-12-03 2011-07-20 中国科学院软件研究所 Resource supply method oriented to Web application host platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100114928A1 (en) * 2008-11-06 2010-05-06 Yahoo! Inc. Diverse query recommendations using weighted set cover methodology

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753534A (en) * 2008-12-10 2010-06-23 徐文祥 Zoning adaptive network system based on cluster server and building method
CN102130938A (en) * 2010-12-03 2011-07-20 中国科学院软件研究所 Resource supply method oriented to Web application host platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《一种分布式智能信息检索系统的研究与实现》;孙良;《CNKI优秀硕士学位论文全文库》;20021231;第35-40页 *
《基于区分服务的集群接纳控制和负载均衡算法》;赵丰收 等;《计算机工程》;20060228;第32卷(第4期);第131-133页 *

Also Published As

Publication number Publication date
CN103023938A (en) 2013-04-03
HK1178712A1 (en) 2013-09-13

Similar Documents

Publication Publication Date Title
CN103023938B (en) A kind of service capability control method of server cluster and system
US9773015B2 (en) Dynamically varying the number of database replicas
US7953691B2 (en) Performance evaluating apparatus, performance evaluating method, and program
US8447757B1 (en) Latency reduction techniques for partitioned processing
US9081624B2 (en) Automatic load balancing, such as for hosted applications
KR101916847B1 (en) Cross-cloud management and troubleshooting
US8700773B2 (en) Load balancing using redirect responses
CN111338773A (en) Distributed timed task scheduling method, scheduling system and server cluster
WO2017016336A1 (en) Method and apparatus for data processing and query
US9594848B2 (en) Load balancing for multi-tiered querying
CN108717457B (en) Electronic commerce platform big data processing method and system
CN112732756B (en) Data query method, device, equipment and storage medium
CN103581332A (en) HDFS framework and pressure decomposition method for NameNodes in HDFS framework
Klems et al. The yahoo! cloud datastore load balancer
Sousa et al. Predictive elastic replication for multi‐tenant databases in the cloud
Gedik et al. A scalable peer-to-peer architecture for distributed information monitoring applications
Tatbul et al. Load management and high availability in the borealis distributed stream processing engine
JP4526774B2 (en) Apparatus and method for performing performance balance evaluation and sizing of computer system components
KR100989490B1 (en) Sysem and its method for load distribution between servers
Nwe et al. A consistent replica selection approach for distributed key-value storage system
CN109254880A (en) A kind of method and device handling database delay machine
Sun et al. Adaptive trade‐off between consistency and performance in data replication
EP2833300B1 (en) Power management of electronic devices configured to generate analytical reports
Shen Distributed storage system model design in internet of things based on hash distribution
Marian et al. A scalable services architecture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1178712

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1178712

Country of ref document: HK

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200825

Address after: Building 8, No. 16, Zhuantang science and technology economic block, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: ALIYUN COMPUTING Co.,Ltd.

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

Patentee before: Alibaba Group Holding Ltd.