CN106789726A - A kind of high concurrent service resource allocation method based on service priority - Google Patents
A kind of high concurrent service resource allocation method based on service priority Download PDFInfo
- Publication number
- CN106789726A CN106789726A CN201611187880.3A CN201611187880A CN106789726A CN 106789726 A CN106789726 A CN 106789726A CN 201611187880 A CN201611187880 A CN 201611187880A CN 106789726 A CN106789726 A CN 106789726A
- Authority
- CN
- China
- Prior art keywords
- service
- service request
- queue
- scheduler
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2483—Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention relates to a kind of high concurrent service resource allocation method based on service priority, comprise the following steps:Start;Scheduler receives the service request of user;Scheduler is that the service request for receiving generates a process;Using the received service request of polling mode forwarding;When there is server to receive the service request, terminate;When Servers-all all suspends access request, the service request that the not serviced device of user receives is stored into insertion respective queue;The time interval t of the service request queue is retransmitted according to priority level initializing, every time t, is retransmitted using polling mode, until there is server free, the service request queue is received, and is terminated.While this method ensures resource energy relatively uniform distribution, realize relatively simple;When Service Source is in short supply, priority business high can preferentially get Service Source.
Description
Technical field
The present invention relates to service resource allocation technical field, more particularly to a kind of high concurrent service based on service priority
Resource allocation methods.
Background technology
In recent years, continuing to develop with computer technology and the communication technology, Internet number of users exponentiallies increase again,
The Internet, applications have obtained rapid popularization.The progress of technology excites the growth of user's request, and business also becomes more complicated, this
The ability for requiring server to provide high concurrent access and reasonable distribution Service Source.
Traditional individual server disposal ability is limited, it is impossible to process high concurrent service request, and by single common clothes
Business device is replaced as its cost of the server of higher performance and too high, and causes the waste of idle server resource again.Therefore
Multiple servers are configured to a server cluster system, the way of external request is jointly processed by, it has also become domestic and international structure
Build the main method of high-performance server.
Group system is more complex compared with traditional individual server is used, and how to be service request reasonable distribution cluster
In Service Source be most critical problem, it will directly affect whether group system can be provided equal or close to expected property
Energy.For example simultaneously when a large amount of requests are reached, certain server node will be caused to be chronically at if service resource allocation is unreasonable
Overload state, and in addition certain server then the long period be in idle condition.Above-mentioned the fact that serious waste collection
The resources advantage of group's system, the request of user also cannot be responded timely, and the overall performance of group system is not also much
Lifting, this with introduce group system original intention do not correspond.Therefore a kind of preferable load balancing scheme must be used, with
Task is just reasonably assigned to each server node in group system as far as possible.
Load-balancing technique occurs along with the appearance of Clustering, it is therefore an objective to be equably scheduled in cluster request
Node, load balancing is accomplished as far as possible.Conventional load-balancing algorithm is divided into two categories below at present:
(1) static scheduling algorithm
Static scheduling algorithm time of occurrence is basis and the blank of other algorithms earliest.Its basic thought is exactly fixed in advance
The better scheduling rule of justice, all of request is allocated according to rule, and with the current state of system, such as load capacity,
The information such as resource utilization are unrelated.
(2) dynamic dispatching algorithm
For static scheduling, dynamic dispatching algorithm adds some feedback mechanisms, and this mechanism can be dynamically
Collect current cluster information, including each node load, type, quantity, the utilization rate of bandwidth, the request delay of new request
Etc..Using these information, we can dynamically change the weights and other some attributes of server, change walking for new connection
To.Such measure load summit and it is unstable when, good adjustment effect can be played, it is to avoid service incline and delay
The situation of machine occurs, and improves the overall performance of cluster.
Because dynamic dispatching algorithm can dynamically change resource allocation policy according to the real time information of system, in reality scene
In have better performance, the current country is related in the patent of load-balancing technique, using the more of dynamic dispatching algorithm.
But, mostly it is in the prior art the angle from load balancing on distributing the scheme of Service Source, very
The rare Resource Allocation Formula for service priority.In the case where Service Source is abundant, because all business can be timely
Service Source is assigned to, priority may be less for the importance of business.However, when Service Source is in short supply, it is not all
Business can in time be assigned to Service Source, just should preferentially be assigned to Service Source for core, urgent business, this
When, priority is just self-evident for the importance of business.
The content of the invention
In view of above-mentioned analysis, the present invention is intended to provide a kind of high concurrent service resource allocation side based on service priority
Method, the method takes into full account service priority, according to priority distributes Service Source, and it is right in conventional load balancing technique to be used to solve
Service priority considers not enough problem.
The purpose of the present invention is mainly achieved through the following technical solutions:
A kind of high concurrent service resource allocation method based on service priority, sets scheduler;The scheduler and service
Servers-all in device cluster is connected;The scheduler is stored with the mark of Servers-all, constitutes the clothes of the server cluster
Business device mark queue;
The high concurrent service resource allocation method comprises the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, the scheduler is that each service request for receiving generates a process;
Step S3, the scheduler using the received service request of polling mode forwarding to server, when there is service
Device Service Source is sufficient, and when receiving the service request, corresponding process terminates;When Servers-all all Service Sources are not enough, temporarily
When stopping access request, step S4 is transferred to;
Step S4, the scheduler stores the service request that not serviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;
Step S6, the time is sent according to service priority and service request, be inserted into for the service request of storage by scheduler
Relevant position in corresponding service request queue;
Specifically, service request queue is made up of priority identical service request, in each service request queue, presses
User sends the time order and function decision queue of service request;
Step S7, service priority of the scheduler in service request queue and the industry in the service request queue
Business quantity set retransmits the time interval t of the service request queue, specifically, meets niti<njtj, wherein i, j represent business please
Queue label is sought, i label service request queues service priority is higher than the service priority of j label service request queues, ni、ti
Service request quantity respectively in the queue of i labels service request and the time interval of the service request queue is retransmitted, nj、tjPoint
Service request quantity that Wei be in j label service request queues and retransmit the time interval of the service request queue;
Step S8, the scheduler is that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue, until this every time t using polling mode
All service request being serviced devices of service request queue receive, and terminate the process.
Further, the step S3 includes following sub-step:
Step S301, scheduler obtains the service request required service resource units number from configuration file;Specifically, use
Family stores in configuration file each type of service required service resource units number, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S302, the scheduler;
Be transmitted to for the service request of reception and the required service resource units number for getting by step S303, the scheduler
The server of tail of the queue mark;
Whether step S304, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required service resource units number of degree device forwarding;It is that the server receives and processes the service request, terminates the process;It is no, should
Server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S301~S304, until there is a server to receive the service request, terminates corresponding process, or institute
There is server to return to " business pause is accessed " response, go to step S4.
Further, the service priority is determined that user is set according to urgent, the significance level of task by user's request
Service priority, by service priority write-in configuration file, is scheduled for device and transfers.
Further, the step S9 includes following sub-step:
Step S901, scheduler obtains first service request required service money of the service request queue from configuration file
Source units;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S902, scheduler;
After step S903, t time interval, the scheduler is by first service request and the industry in the service request queue
Business request required service resource units number is transmitted to the server of tail of the queue mark;
Whether step S904, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required resource units number of degree device forwarding;It is that the server receives and processes first described service request, and scheduler should
Service request is deleted from business request queue;No, the server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S901~S904, until the equal being serviced device of all service requests in the service request queue connects
Receive, terminate the process.
Further, scheduler uses two-server to be realized with active/standby mode.
The present invention is in order to solve the above technical problems, there is provided the another kind high concurrent Service Source based on service priority point
Method of completing the square, specially:
Scheduler is set;The scheduler is connected with the Servers-all in server cluster;The scheduler is stored with all
The mark of server, constitutes the server identification queue of the server cluster;Scheduler is at regular intervals to Servers-all
Inquiry Service Source Expenditure Levels, obtain the total resources consumption ratio of server cluster;
The high concurrent service resource allocation method comprises the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, scheduler judges whether the total resources consumption ratio of current server cluster reaches the threshold set by scheduler
Value;Judged result is when being, to go to step S5;When judged result is no, S3 is gone to step;
Step S3, the scheduler is that each service request for receiving generates a process;
Step S4, the scheduler using the received service request of polling mode forwarding to server, when there is service
Device Service Source is sufficient, and when receiving the service request, corresponding process terminates;
Step S5, the scheduler stores the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Business is excellent
First level is determined that user sets service priority according to urgent, the significance level of task, and service priority is write by user's request
Enter in configuration file, be scheduled for device and transfer;
Step S7, the time sent according to service priority and service request, the service request is inserted into corresponding service
Relevant position in request queue;
Specifically, service request queue is made up of priority identical service request, in each service request queue, presses
User sends the time order and function decision queue of service request;
Step S8, service priority of the scheduler in service request queue and the industry in the service request queue
Business quantity set retransmits the time interval t of the service request queue, specifically, meets niti<njtj, wherein i, j represent business please
Queue label is sought, i service request queues service priority is higher than the service priority of j service request queues, ni、tiRespectively i industry
Service request quantity in business request queue and the time interval of the service request queue is retransmitted, nj、tjRespectively j service requests
Service request quantity in queue and retransmit the time interval of the service request queue;
Step S9, the scheduler is that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue, until this every time t using polling mode
All service request being serviced devices of service request queue receive, and stop retransmitting the service request queue, terminate the process;
Further, the threshold value is determined that set according to actual conditions, setting principle is with excellent to business by user's request
First level stresses the increase of degree, reduces the threshold value.
Further, the threshold value is taken as 75%.
Further, the step S4 includes following sub-step:
Step S401, scheduler obtains the service request required service resource units number from configuration file;Specifically, use
Family stores in configuration file each type of service required service resource units number, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S402, the scheduler;
Step S403, the required service resource units number that the scheduler will get is transmitted to the service of tail of the queue mark
Device;
Whether step S404, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required service resource units number of degree device forwarding;It is that the server receives and processes the service request, terminates the process, no, should
Server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S401~S404, until there is a server to receive the service request.
Further, the step S10 includes following sub-step:
Step S1001, scheduler obtains first service request required service of the service request queue from configuration file
Resource units number;
After step S1002, t time interval, the team's head element in server identification queue is gone out team and inserts team by scheduler
Tail;
Step S1003, the scheduler is by first service request required service resource units in the service request queue
Number is transmitted to the server of tail of the queue mark;
Step S1004, the server of the tail of the queue mark judges whether self residual Service Source units is more than or equal to
The required resource units number of scheduler forwarding;It is that the server receives and first business in processing business request queue please
Ask, corresponding service request is deleted from business request queue;No, then the server is returned " business pause is accessed " to scheduler
Response;
Repeat the above steps S1001~S1004, until the equal being serviced device of all service requests in the service request queue
Receive, stop retransmitting the service request queue, terminate the process.
The present invention has the beneficial effect that:
1st, the present invention set scheduler be high concurrent traffic assignments Service Source, to high concurrent business in each business
Request one process of generation, one service request of each process independent process.To any bar service request by the way of poll
Distribution Service Source, while resource energy relatively uniform distribution is ensured, realizes relatively simple.
2nd, the present invention devises a kind of mechanism that service resource allocation is realized according to service priority, it is ensured that provided in service
When source is in short supply, priority business high can preferentially get Service Source.
3rd, the present invention realizes service priority by the size of the time interval of service request repeating transmission, the reality of the priority
Existing mode ensure that the business of different priorities can within a certain period of time get Service Source, be not in low priority
Business cannot all obtain the situation of Service Source within a very long time, therefore be very suitable for the scene of high concurrent business
4th, by setting threshold value, the allocation strategy based on priority is opened when thinking necessary by user, it is ensured that
In Service Source relative deficiency, the business for enabling priority high preferentially gets Service Source.
Other features and advantages of the present invention will be illustrated in the following description, also, the partial change from specification
Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can be by the explanations write
Specifically noted structure is realized and obtained in book, claims and accompanying drawing.
Brief description of the drawings
Accompanying drawing is only used for showing the purpose of specific embodiment, and is not considered as limitation of the present invention, in whole accompanying drawing
In, identical reference symbol represents identical part.
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one.
Fig. 2 is the schematic flow sheet of the embodiment of the present invention three.
Specific embodiment
The preferred embodiments of the present invention are specifically described below in conjunction with the accompanying drawings, wherein, accompanying drawing constitutes the application part, and
It is used to explain principle of the invention together with embodiments of the present invention.
Embodiment one,
The present embodiment, before service resource allocation is carried out, sets scheduler;During scheduler can be server cluster
Any server, can individually be scheduled, it is also possible to while processing business is asked.Institute in the scheduler and server cluster
There is server to be connected;The scheduler is stored with the mark of Servers-all, constitutes the server identification queue of the server cluster.
Scheduler is realized using a high performance network server with polylith network interface card.In order to improve fault-tolerance, using active/standby mode,
Realize dual-locomotive heat back-up (i.e. set of system while being deployed on two-server, if host computer system goes out with two-server
Existing failure, then be immediately switched to be run on standby host).
Present embodiment discloses a kind of high concurrent service resource allocation method based on service priority, as shown in figure 1,
Comprise the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, the scheduler is that each service request for receiving generates a process;
Step S3, the scheduler using the received service request of polling mode forwarding to server, when there is service
Device Service Source is sufficient, and when receiving the service request, corresponding process terminates;When Servers-all all Service Sources are not enough, temporarily
When stopping access request, step S4 is transferred to;
Including following sub-step:
Step S301, scheduler obtains the service request required service resource units number from configuration file;Specifically, use
Family stores in configuration file each type of service required service resource units number, is scheduled for device acquisition;
Different business is different to the demand of Service Source, and a Service Source units, such as a industry are assigned to every kind of business
Business it is smaller to resources requirement, assign its 1 Service Source of unit, b business is slightly larger to Service Source demand, assign its 2
The resource of individual unit, concurrently sets the total resource units number of server, and when 10000 units are set to, server can be simultaneously
The most 10000 a service requests of concurrent processing or 5000 b service requests, or 8000 a business and 1000 b business.
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S302, the scheduler;
Be transmitted to for the service request of reception and the required service resource units number for getting by step S303, the scheduler
The server of tail of the queue mark;
Whether step S304, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required service resource units number of degree device forwarding;It is that the server receives and processes the service request, terminates the process, no, should
Server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S301~S304, and until there is a server to receive the service request, corresponding process terminates;Or institute
There is server to return to " business pause is accessed " response, be transferred to step S4.
Step S4, the scheduler stores the service request that not serviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;Business is excellent
First level is determined by user's request, according to urgent, the significance level of task, sets service priority, and service priority write-in is matched somebody with somebody
Put in file, be scheduled for device and transfer;
When Service Source is relatively abundant, different business is not obvious to the contention of resource because these business can and
When be assigned to Service Source, but when Service Source is in short supply, existing resource can not in time meet all of business, this
When, the priority of resource allocation is just particularly important.Assigned for those urgent, important, core service neededs
Their of a relatively high priority, it is ensured that they are preferentially assigned to resource, and not urgent, secondary, non-core for those
Business can assign their relatively low priority.
Step S6, the time is sent according to service priority and service request, be inserted into for the service request of storage by scheduler
Relevant position in corresponding service request queue;
Specifically, service request queue is made up of priority identical service request, in each service request queue, presses
User sends the time order and function decision queue of service request;
Step S7, service priority of the scheduler in service request queue and the business number in the service request queue
The time interval t of the service request queue is retransmitted in amount setting, specifically, meets niti<njtj, wherein i, j represent service request team
Row label, i label service request queues service priority is higher than the service priority of j label service request queues, ni、tiRespectively
For the service request quantity in i label service request queues and retransmit the time interval of the service request queue, nj、tjRespectively j
Service request quantity in label service request queue and retransmit the time interval of the service request queue;
Step S8, the scheduler is that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue, until this every time t using polling mode
All service request being serviced devices of service request queue receive, and terminate the process;Including following sub-step:
Step S901, scheduler obtains first service request required service money of the service request queue from configuration file
Source units;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S902, scheduler;
After step S903, t time interval, the scheduler is by first service request and the industry in the service request queue
Business request required service resource units number is transmitted to the server of tail of the queue mark;
Whether step S904, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required resource units number of degree device forwarding;It is that the server receives and processes first described service request, and scheduler should
Service request is deleted from business request queue;No, the server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S901~S904, until the equal being serviced device of all service requests in the service request queue connects
Receive, terminate the process.
The working condition of server is divided into load less than, two states of full load in the present embodiment cluster.Load is less than referring to
Be the server for also having not up to full load in cluster.If individual server has reached the peak load of work, i.e., full
Load, will refuse new request, and when all of server all runnings at full capacity in cluster, then whole cluster is in full load
State, it is impossible to process new request.When cluster load less than when, do not differentiate between priority between different business, i.e., scheduler is with identical
Priority is that different business distributes Service Source.Now, scheduler uses the mode of polling dispatching come for each traffic assignments takes
Business resource.If response that all of server is all returned in dispatcher queue " business pause is accessed ", illustrates now server set
Group has been in full load state, then into the full load stage.When cluster is in full load state, Service Source has been in deficient
Weary state, after the request of scheduler is by Servers-all response " business pause is accessed ", illustrates not available in cluster
Service Source.
The present embodiment is thought highly of the frequency (i.e. time interval) that sending service asks and controls Service Source by configuration scheduling
Distribution.Specifically, when scheduler finds that server cluster has reached full load, can be by current service request interim storage
Get off, t retransmits the request at regular intervals, retransmitted until the request to be received just stop.Now, if several inhomogeneities
The business of type is provided in contention Service Source in order to allow more urgent, important, core business to be preferentially quickly distributed to service
Source, can retransmit scheduler the height of the frequency setting of the type service request, i.e., the time interval t's for retransmitting the request
It is smaller that value sets.
Embodiment two,
For ease of understanding, provide one and specifically use example.
In core communication system, there are three kinds of business to be required for the calculating service provided using calculation server cluster, its
Priority is respectively crucial control business, operational administrative business, general inquiry business from high to low.
Assuming that calculation server cluster is made up of 10 single calculation servers, and externally provide access controller
ServController is scheduler as unified access point, is responsible for receiving the business of forwarding user terminal by ServController
Ask to be processed to calculation server cluster.When calculation server cluster operational capability is still available free, for three kinds of business
Computing resource request, ServController calls 10 calculation servers with equal priority using polling mode.It is elected
The calculation server calculated load selected has expired, then the calculation server returns to " business pause is accessed " and rings to ServController
Should, ServController is used according to next calculation server in return value selective listing, the like, when in list
In the case of all calculation servers all polls one time and all return " business pause is accessed ", ServController is deposited temporarily
The business request information is stored up, calculation server is reselected after the n seconds time of interval.
Now all in the case of at full capacity, ServController activates preferential fraction to all calculation servers automatically
With strategy, the business for controlling high priority by the size of automatic setting different business retransmittal interval n preferentially gets
Computing resource is processed.Crucial control business n=1s, operational administrative business n=2s, general inquiry business n=5s are such as set,
When calculation server collection group operatione at full capacity when, three kinds of service requests are all responded " business pause is accessed ", now,
ServController retransmits three kinds of service requests again after 1s, 2s, 5s respectively, after 1s, any one calculation server from
Become idle at full capacity, then crucial control business obtains calculating Service Source at first;After 2s, another calculation server is from completely
Load becomes idle, and the business without priority of resource allocation higher is present, and now operational administrative business can be counted
Calculate Service Source.Obviously, in this way, priority of resource allocation business higher can preferentially be obtained in contention for resources
Service Source, the low business of priority also will not cannot all obtain Service Source within a very long time.
Embodiment three,
Above-described embodiment one, two is opened based on priority distribution service money in the case of server cluster full load,
Source, in order that business promptly, important obtains service resources faster, present embodiments provides a kind of preferential based on threshold value unlatching
The example of level distribution Service Source.
Present embodiment discloses a kind of high concurrent service resource allocation method based on service priority, scheduler is every one
Fix time and inquire Service Source Expenditure Levels to Servers-all, the total resources consumption ratio of server cluster is obtained, when total money
When source consumption is than the threshold for reaching scheduler setting, illustrate that now Service Source is not abundant enough, in order to allow urgent business
Preferentially get resource, the method for salary distribution regardless of priority mean allocation resource before stopping, but first forwarding priority compared with
Service request high, then the relatively low service request of forwarding priority.
As shown in Fig. 2 comprising the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, scheduler judges whether the total resources consumption ratio of current server cluster reaches the threshold set by scheduler
Value;Judged result is when being, to go to step S5;When judged result is no, S3 is gone to step;The threshold value determines by user's request, according to
Actual conditions are set, and with the increase for stressing degree to service priority, reduce the threshold value;Optimal threshold is 75%, that is, exist
Resource consumption ratio reach more than 75% Service Source it is relatively nervous when open priority allocation strategy, to ensure to increase scheduling
Device program, the equilibrium for considering both priority distribution Service Sources.
Step S3, the scheduler is that each service request for receiving generates a process;
Step S4, the scheduler using the received service request of polling mode forwarding to server, when there is service
Device Service Source is sufficient, and when receiving the service request, corresponding process terminates;
Including following sub-step:
Step S401, scheduler obtains the service request required service resource units number from configuration file;Specifically, use
Family stores in configuration file each type of service required service resource units number, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S402, the scheduler;
Step S403, the required service resource units number that the scheduler will get is transmitted to the service of tail of the queue mark
Device;
Whether step S404, the server of the tail of the queue mark judges self residual Service Source units more than or equal to tune
The required service resource units number of degree device forwarding;It is that the server receives and processes the service request, terminates the process, no, should
Server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S401~S404, until there is a server to receive the service request.
Step S5, the scheduler stores the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Business is excellent
First level is determined that user sets service priority according to urgent, the significance level of task, and service priority is write by user's request
Enter in configuration file, be scheduled for device and transfer;
Step S7, the time sent according to service priority and service request, the service request is inserted into corresponding service
Relevant position in request queue;
Specifically, service request queue is made up of priority identical service request, in each service request queue, presses
User sends the time order and function decision queue of service request;
Step S8, service priority of the scheduler in service request queue and the business number in the service request queue
The time interval t of the service request queue is retransmitted in amount setting, specifically, meets niti<njtj, wherein i, j represent service request team
Row label, i label service request queues service priority is higher than the service priority of j label service request queues, ni、tiRespectively
For the service request quantity in i label service request queues and retransmit the time interval of the service request queue, nj、tjRespectively j
Service request quantity in label service request queue and retransmit the time interval of the service request queue;
Step S9, the scheduler is that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue, until this every time t using polling mode
All service request being serviced devices of service request queue receive, and stop retransmitting the service request queue, terminate the process;Including
Following sub-step:
Step S1001, scheduler obtains first service request required service of the service request queue from configuration file
Resource units number;
After step S1002, t time interval, the team's head element in server identification queue is gone out team and inserts team by scheduler
Tail;
Step S1003, the scheduler is by first service request required service resource units in the service request queue
Number is transmitted to the server of tail of the queue mark;
Step S1004, the server of the tail of the queue mark judges whether self residual Service Source units is more than or equal to
The required resource units number of scheduler forwarding;It is that the server receives and first business in processing business request queue please
Ask, corresponding service request is deleted from business request queue;No, then the server is returned " business pause is accessed " to scheduler
Response;
Repeat the above steps S1001~S1004, until the equal being serviced device of all service requests in the service request queue
Receive, stop retransmitting the service request queue, terminate the process.
The present invention has advantages below:
1st, it is high concurrent traffic assignments Service Source that the present invention uses the mode of poll, is ensureing relatively uniform point of resource energy
With while, realize relatively simple.
2nd, the present invention devises a kind of resource allocation mechanism by service priority, it is ensured that relatively in short supply in Service Source
When, priority business high can preferentially get Service Source.
3rd, the present invention realizes service priority by the size of the time interval of service request repeating transmission, the reality of the priority
Existing mode ensure that the business of different priorities can within a certain period of time get Service Source, be not in low priority
Business cannot all obtain the situation of Service Source within a very long time, therefore be very suitable for the scene of high concurrent business.
It will be understood by those skilled in the art that all or part of flow of above-described embodiment method is realized, can be by meter
Calculation machine program is completed to instruct the hardware of correlation, and described program can be stored in computer-readable recording medium.Wherein, institute
It is disk, CD, read-only memory or random access memory etc. to state computer-readable recording medium.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto,
Any one skilled in the art the invention discloses technical scope in, the change or replacement that can be readily occurred in,
Should all be included within the scope of the present invention.
Claims (10)
1. a kind of high concurrent service resource allocation method based on service priority, it is characterised in that:Scheduler is set;The scheduling
Device is connected with the Servers-all in server cluster;The scheduler is stored with the mark of Servers-all, constitutes the server
The server identification queue of cluster;
The high concurrent service resource allocation method comprises the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, the scheduler is that each service request for receiving generates a process;
Step S3, the scheduler, to server, is taken using the received service request of polling mode forwarding when there is server
Business resource is sufficient, and when receiving the service request, corresponding process terminates;When Servers-all all Service Sources are not enough, pause connects
When entering to ask, step S4 is transferred to;
Step S4, the scheduler stores the service request that not serviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;
Step S6, the time is sent according to service priority and service request, be inserted into the service request of storage accordingly by scheduler
Service request queue in relevant position;
Specifically, service request queue is made up of priority identical service request, in each service request queue, by user
Send the time order and function decision queue of service request;
Step S7, service priority of the scheduler in service request queue and the business in the service request queue please
Ask quantity set to retransmit the time interval t of the service request queue, specifically, meet niti<njtj, wherein i, j represent business please
Queue label is sought, i service request queues service priority is higher than the service priority of j service request queues, ni、tiRespectively i industry
Service request quantity in business request queue and the time interval of the service request queue is retransmitted, nj、tjRespectively j service requests
Service request quantity in queue and retransmit the time interval of the service request queue;
Step S8, the scheduler is that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue, until the business every time t using polling mode
All service request being serviced devices of request queue receive, and terminate the process.
2. high concurrent service resource allocation method according to claim 1, it is characterised in that:The step S3 includes as follows
Sub-step:
Step S301, scheduler obtains the service request required service resource units number from configuration file;Specifically, user will
Each type of service required service resource units number storage is scheduled for device acquisition in configuration file;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S302, the scheduler;
The service request of reception and the required service resource units number for getting are transmitted to tail of the queue by step S303, the scheduler
The server of mark;
Whether step S304, the server of the tail of the queue mark judges self residual Service Source units more than or equal to scheduler
The required service resource units number of forwarding;It is that the server receives and processes the service request, terminates the process, no, the service
Device returns to " business pause is accessed " response to scheduler;
Repeat the above steps S301~S304, and until there is a server to receive the service request, corresponding process terminates;Or it is all
Server returns to " business pause is accessed " response, is transferred to step S4.
3. high concurrent service resource allocation method according to claim 1, it is characterised in that:The service priority by with
Family demand is determined, according to urgent, the significance level of task, sets service priority, during service priority write into configuration file,
Device is scheduled for transfer.
4. high concurrent service resource allocation method according to claim 1, it is characterised in that:The step S9 includes as follows
Sub-step:
Step S901, scheduler obtains first service request required service resource list of the service request queue from configuration file
Digit;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S902, scheduler;
After step S903, t time interval, the scheduler please by first service request in the service request queue and the business
Required service resource units number is asked to be transmitted to the server of tail of the queue mark;
Whether step S904, the server of the tail of the queue mark judges self residual Service Source units more than or equal to scheduler
The required resource units number of forwarding;It is that the server receives and processes first described service request, scheduler is by the business
Request is deleted from business request queue;No, the server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S901~S904, until the equal being serviced device of all service requests in the service request queue receives,
Terminate the process.
5. high concurrent service resource allocation method according to claim 1, it is characterised in that:The scheduler uses two
Server is realized with active/standby mode.
6. a kind of high concurrent service resource allocation method based on service priority, it is characterised in that:Scheduler is set;The scheduling
Device is connected with the Servers-all in server cluster;The scheduler is stored with the mark of Servers-all, constitutes the server
The server identification queue of cluster;Scheduler inquires Service Source Expenditure Levels to Servers-all at regular intervals, obtains
The total resources consumption ratio of server cluster;
The high concurrent service resource allocation method comprises the following steps:
Step S1, scheduler receives the service request that user sends;
Step S2, scheduler judges whether the total resources consumption ratio of current server cluster reaches the threshold value set by scheduler;
Judged result is when being, to go to step S5;When judged result is no, S3 is gone to step;
Step S3, the scheduler is that each service request for receiving generates a process;
Step S4, the scheduler, to server, is taken using the received service request of polling mode forwarding when there is server
Business resource is sufficient, and when receiving the service request, corresponding process terminates;
Step S5, the scheduler stores the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Service priority
Determined by user's request, user sets service priority according to urgent, the significance level of task, service priority write-in is matched somebody with somebody
Put in file, be scheduled for device and transfer;
Step S7, the time sent according to service priority and service request, the service request is inserted into corresponding service request
Relevant position in queue;
Specifically, service request queue is made up of priority identical service request, in each service request queue, by user
Send the time order and function decision queue of service request;
Step S8, service priority of the scheduler in service request queue and the business in the service request queue please
Ask quantity set to retransmit the time interval t of the service request queue, specifically, meet niti<njtj, wherein i, j represent business please
Queue label is sought, i service request queues service priority is higher than the service priority of j service request queues, ni、tiRespectively i industry
Service request quantity in business request queue and the time interval of the service request queue is retransmitted, nj、tjRespectively j service requests
Service request quantity in queue and retransmit the time interval of the service request queue;
Step S9, the scheduler is that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue, until the business every time t using polling mode
All service request being serviced devices of request queue receive, and stop retransmitting the service request queue, terminate the process.
7. high concurrent service resource allocation method according to claim 6, it is characterised in that:The threshold value is by user's request
Determine, set according to actual conditions, setting principle is, with the increase for stressing service priority degree, to reduce the threshold value.
8. high concurrent service resource allocation method according to claim 7, it is characterised in that:The threshold value is taken as 75%.
9. high concurrent service resource allocation method according to claim 6, it is characterised in that:The step S4 includes as follows
Sub-step:
Step S401, scheduler obtains the service request required service resource units number from configuration file;Specifically, user will
Each type of service required service resource units number storage is scheduled for device acquisition in configuration file;
Team's head element in server identification queue is gone out team and inserts tail of the queue by step S402, the scheduler;
Step S403, the required service resource units number that the scheduler will get is transmitted to the server of tail of the queue mark;
Whether step S404, the server of the tail of the queue mark judges self residual Service Source units more than or equal to scheduler
The required service resource units number of forwarding;It is that the server receives and processes the service request, terminates the process;It is no, the service
Device returns to " business pause is accessed " response to scheduler;
Repeat the above steps S401~S404, until there is a server to receive the service request, terminates corresponding process.
10. high concurrent service resource allocation method according to claim 6, it is characterised in that:The step S10 is included such as
Lower sub-step:
Step S1001, scheduler obtains first service request required service resource of the service request queue from configuration file
Units;
After step S1002, t time interval, the team's head element in server identification queue is gone out team and inserts tail of the queue by scheduler;
Step S1003, the scheduler turns first service request required service resource units number in the service request queue
Issue the server of tail of the queue mark;
Whether step S1004, the server of the tail of the queue mark judges self residual Service Source units more than or equal to scheduling
The required resource units number of device forwarding;It is that the server receives and first service request in processing business request queue, phase
The service request answered is deleted from business request queue;No, then the server returns to " business pause is accessed " response to scheduler;
Repeat the above steps S1001~S1004, until the equal being serviced device of all service requests in the service request queue connects
Receive, stop retransmitting the service request queue, terminate the process.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611187880.3A CN106789726B (en) | 2016-12-20 | 2016-12-20 | A kind of high concurrent service resource allocation method based on service priority |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611187880.3A CN106789726B (en) | 2016-12-20 | 2016-12-20 | A kind of high concurrent service resource allocation method based on service priority |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106789726A true CN106789726A (en) | 2017-05-31 |
CN106789726B CN106789726B (en) | 2019-09-10 |
Family
ID=58894324
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611187880.3A Active CN106789726B (en) | 2016-12-20 | 2016-12-20 | A kind of high concurrent service resource allocation method based on service priority |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106789726B (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107230026A (en) * | 2017-06-21 | 2017-10-03 | 安徽瑞弋自动化科技有限公司 | A kind of industrial equipment polling control method |
CN107633451A (en) * | 2017-10-23 | 2018-01-26 | 深圳市中润四方信息技术有限公司 | A kind of tax-related service processing method, system |
CN107948095A (en) * | 2017-11-21 | 2018-04-20 | 中国银行股份有限公司 | A kind of resource control method, device and bus system server |
CN108111499A (en) * | 2017-12-15 | 2018-06-01 | 腾讯科技(深圳)有限公司 | Service process performance optimization method, device, electronic equipment and storage medium |
CN108124003A (en) * | 2017-12-11 | 2018-06-05 | 中盈优创资讯科技有限公司 | Network management device connection processing method, apparatus and system |
CN108303688A (en) * | 2018-04-27 | 2018-07-20 | 北京东远润兴科技有限公司 | Reconfiguration system, method and the radar system of Radar Signal Processing |
CN108510093A (en) * | 2018-03-29 | 2018-09-07 | 重庆柚瓣家科技有限公司 | Community service reservation system |
CN108573313A (en) * | 2018-03-29 | 2018-09-25 | 重庆柚瓣家科技有限公司 | Intensive service deployment method for family endowment |
CN109492926A (en) * | 2018-11-22 | 2019-03-19 | 中国银行股份有限公司 | A kind of transaction dispatcher method and system based on preferential level adaptation |
CN110086848A (en) * | 2019-03-15 | 2019-08-02 | 平安普惠企业管理有限公司 | Sending method, device, computer equipment and the storage medium of network request |
WO2020063381A1 (en) * | 2018-09-30 | 2020-04-02 | 京东方科技集团股份有限公司 | Data communication method, server device, client device and medium |
CN111026555A (en) * | 2019-12-23 | 2020-04-17 | 北京数衍科技有限公司 | Priority flow compensation method and device and electronic equipment |
CN111737000A (en) * | 2020-06-22 | 2020-10-02 | 四川长虹电器股份有限公司 | Method for realizing load balance |
CN113168330A (en) * | 2018-10-03 | 2021-07-23 | 推特公司 | Client software fallback |
CN113239061A (en) * | 2021-05-31 | 2021-08-10 | 浙江环玛信息科技有限公司 | Intelligent court data updating method and system |
CN113467909A (en) * | 2021-06-29 | 2021-10-01 | 北京房江湖科技有限公司 | Time consuming method and apparatus for compressing concurrent requests |
CN116208680A (en) * | 2023-05-04 | 2023-06-02 | 成都三合力通科技有限公司 | Server access management system and method |
CN117112239A (en) * | 2023-10-23 | 2023-11-24 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | Extensible load balancing method and system on heterogeneous reasoning back end |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102497421A (en) * | 2011-12-12 | 2012-06-13 | 湖南科技大学 | Web server cluster system round-robin scheduling load balancing method with good fairness |
CN103428870A (en) * | 2012-05-22 | 2013-12-04 | 中兴通讯股份有限公司 | Method and device for determining priority of access service |
CN104202261A (en) * | 2014-08-27 | 2014-12-10 | 华为技术有限公司 | Service request processing method and device |
CN104243405A (en) * | 2013-06-08 | 2014-12-24 | 华为技术有限公司 | Request processing method, device and system |
-
2016
- 2016-12-20 CN CN201611187880.3A patent/CN106789726B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102497421A (en) * | 2011-12-12 | 2012-06-13 | 湖南科技大学 | Web server cluster system round-robin scheduling load balancing method with good fairness |
CN103428870A (en) * | 2012-05-22 | 2013-12-04 | 中兴通讯股份有限公司 | Method and device for determining priority of access service |
CN104243405A (en) * | 2013-06-08 | 2014-12-24 | 华为技术有限公司 | Request processing method, device and system |
CN104202261A (en) * | 2014-08-27 | 2014-12-10 | 华为技术有限公司 | Service request processing method and device |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107230026A (en) * | 2017-06-21 | 2017-10-03 | 安徽瑞弋自动化科技有限公司 | A kind of industrial equipment polling control method |
CN107633451A (en) * | 2017-10-23 | 2018-01-26 | 深圳市中润四方信息技术有限公司 | A kind of tax-related service processing method, system |
CN107948095B (en) * | 2017-11-21 | 2021-11-02 | 中国银行股份有限公司 | Resource control method and device and bus system server |
CN107948095A (en) * | 2017-11-21 | 2018-04-20 | 中国银行股份有限公司 | A kind of resource control method, device and bus system server |
CN108124003A (en) * | 2017-12-11 | 2018-06-05 | 中盈优创资讯科技有限公司 | Network management device connection processing method, apparatus and system |
CN108111499A (en) * | 2017-12-15 | 2018-06-01 | 腾讯科技(深圳)有限公司 | Service process performance optimization method, device, electronic equipment and storage medium |
CN108510093A (en) * | 2018-03-29 | 2018-09-07 | 重庆柚瓣家科技有限公司 | Community service reservation system |
CN108573313A (en) * | 2018-03-29 | 2018-09-25 | 重庆柚瓣家科技有限公司 | Intensive service deployment method for family endowment |
CN108303688A (en) * | 2018-04-27 | 2018-07-20 | 北京东远润兴科技有限公司 | Reconfiguration system, method and the radar system of Radar Signal Processing |
WO2020063381A1 (en) * | 2018-09-30 | 2020-04-02 | 京东方科技集团股份有限公司 | Data communication method, server device, client device and medium |
CN110971533A (en) * | 2018-09-30 | 2020-04-07 | 京东方科技集团股份有限公司 | Method, server apparatus, client apparatus, and medium for data communication |
CN110971533B (en) * | 2018-09-30 | 2023-02-03 | 京东方科技集团股份有限公司 | Method, server apparatus, client apparatus, and medium for data communication |
CN113168330A (en) * | 2018-10-03 | 2021-07-23 | 推特公司 | Client software fallback |
CN109492926A (en) * | 2018-11-22 | 2019-03-19 | 中国银行股份有限公司 | A kind of transaction dispatcher method and system based on preferential level adaptation |
CN110086848A (en) * | 2019-03-15 | 2019-08-02 | 平安普惠企业管理有限公司 | Sending method, device, computer equipment and the storage medium of network request |
CN110086848B (en) * | 2019-03-15 | 2023-07-21 | 安徽银柏电子科技有限公司 | Network request sending method and device, computer equipment and storage medium |
CN111026555A (en) * | 2019-12-23 | 2020-04-17 | 北京数衍科技有限公司 | Priority flow compensation method and device and electronic equipment |
CN111026555B (en) * | 2019-12-23 | 2023-11-24 | 北京数衍科技有限公司 | Priority level flow separation compensation method and device and electronic equipment |
CN111737000A (en) * | 2020-06-22 | 2020-10-02 | 四川长虹电器股份有限公司 | Method for realizing load balance |
CN113239061A (en) * | 2021-05-31 | 2021-08-10 | 浙江环玛信息科技有限公司 | Intelligent court data updating method and system |
CN113239061B (en) * | 2021-05-31 | 2023-02-10 | 浙江环玛信息科技有限公司 | Intelligent court data updating method and system |
CN113467909A (en) * | 2021-06-29 | 2021-10-01 | 北京房江湖科技有限公司 | Time consuming method and apparatus for compressing concurrent requests |
CN113467909B (en) * | 2021-06-29 | 2022-03-15 | 贝壳找房(北京)科技有限公司 | Time consuming method and apparatus for compressing concurrent requests |
CN116208680A (en) * | 2023-05-04 | 2023-06-02 | 成都三合力通科技有限公司 | Server access management system and method |
CN117112239A (en) * | 2023-10-23 | 2023-11-24 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | Extensible load balancing method and system on heterogeneous reasoning back end |
CN117112239B (en) * | 2023-10-23 | 2024-02-09 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | Extensible load balancing method and system on heterogeneous reasoning back end |
Also Published As
Publication number | Publication date |
---|---|
CN106789726B (en) | 2019-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106789726B (en) | A kind of high concurrent service resource allocation method based on service priority | |
CN1744575B (en) | Method for improving quality-of-service management in networks | |
CN101257445B (en) | Method for synchronous traffic shaping | |
CN103856393B (en) | Distributed message middleware system and its operation method based on database | |
CN104081736B (en) | The system and method for schedule packet transmissions on client device | |
EP2702730B1 (en) | Effective circuits in packet-switched networks | |
CN102833352A (en) | Distributed cache management system and method for implementing distributed cache management | |
CN103079273A (en) | Resource management method suitable for multilayer satellite system | |
CN103986766A (en) | Self-adaptation load balancing job task scheduling method and device | |
CN103647726A (en) | Message dispatching method and device thereof | |
CN103873523A (en) | Client cluster access method and device | |
CN101729386A (en) | Flow control method and device based on token scheduling | |
CN109962760A (en) | A kind of business scheduling method suitable for wireless TDMA ad hoc network | |
CN114500401B (en) | Resource scheduling method and system for coping with burst traffic | |
CN102711216A (en) | Transmission resource selection method, user equipment, determining method and access network equipment | |
CN101808037B (en) | Method and device for traffic management in switch network | |
CN102799488B (en) | Application resource management system applied to digital television | |
CN102143053B (en) | Method, device and system for transmitting data | |
CN102281202A (en) | Dispatching method, server and system | |
CN109714223B (en) | System and method for realizing network service access dynamic load sharing function under NFV architecture | |
CN105873223A (en) | Service scheduling method, service scheduling device, wireless network controller and base station | |
CN1901548B (en) | Buffer zone managing method | |
CN113992609B (en) | Method and system for processing multilink service data disorder | |
CN100474970C (en) | Method for assigning transmission resource in transmission layer | |
Sunay et al. | Efficient allocation of radio resources for CDMA based wireless packet data systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |