CN106789726B - 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 PDF

Info

Publication number
CN106789726B
CN106789726B CN201611187880.3A CN201611187880A CN106789726B CN 106789726 B CN106789726 B CN 106789726B CN 201611187880 A CN201611187880 A CN 201611187880A CN 106789726 B CN106789726 B CN 106789726B
Authority
CN
China
Prior art keywords
service
service request
scheduler
queue
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.)
Active
Application number
CN201611187880.3A
Other languages
Chinese (zh)
Other versions
CN106789726A (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.)
XINGTANG COMMUNICATIONS CO Ltd
Original Assignee
XINGTANG COMMUNICATIONS CO 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 XINGTANG COMMUNICATIONS CO Ltd filed Critical XINGTANG COMMUNICATIONS CO Ltd
Priority to CN201611187880.3A priority Critical patent/CN106789726B/en
Publication of CN106789726A publication Critical patent/CN106789726A/en
Application granted granted Critical
Publication of CN106789726B publication Critical patent/CN106789726B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2483Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing

Abstract

The high concurrent service resource allocation method based on service priority that the present invention relates to a kind of, includes the following steps: to start;Scheduler receives the service request of user;Scheduler is that the service request received 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 unserviced device of user receives is stored into insertion respective queue;It is retransmitted every time t using polling mode according to the time interval t that priority level initializing retransmits the service request queue, until there is server free, which is received, and is terminated.While this method guarantees resource energy relatively uniform distribution, realize relatively simple;When Service Source is in short supply, the high business of priority can preferentially get Service Source.

Description

A kind of high concurrent service resource allocation method based on service priority
Technical field
The present invention relates to service resource allocation technical field more particularly to a kind of high concurrent services based on service priority Resource allocation methods.
Background technique
In recent years, with the continuous development of computer technology and the communication technology, Internet number of users exponentially increases again, Internet application has obtained rapid proliferation.The progress of technology excites the growth of user demand, and business also becomes more complicated, this Server is required to provide the ability of high concurrent access and reasonable distribution Service Source.
Traditional individual server processing capacity is limited, can not handle high concurrent service request, and by single common clothes It is again excessively high that business device is replaced as its cost of the server of higher performance, and causes the waste of idle server resource again.Therefore Multiple servers are configured to a server cluster system, are jointly processed by the way of external request, it has also become domestic and international structure Build the main method of high-performance server.
Group system is compared with using traditional individual server more complex, how for service request reasonable distribution cluster In Service Source the problem of being most critical, it will directly affect whether group system can be provided equal or close to expected property Energy.Such as when largely requesting while reaching, if the unreasonable certain server node that will lead to of service resource allocation is chronically at Overload state, and in addition then the long period is in idle condition certain server.The above situation serious waste collection The resources advantage of group's system, the request of user also cannot be responded timely, and also there is no much for the overall performance of group system Promotion, this with introduce group system original intention be not consistent.Therefore a kind of preferable load balancing scheme must be used, with Just each server node task being reasonably assigned to as far as possible in group system.
Load-balancing technique occurs along with the appearance of Clustering, it is therefore an objective to equably be scheduled to request in cluster Node, accomplish load balancing as far as possible.Currently used load-balancing algorithm is divided into following two categories:
(1) static scheduling algorithm
Static scheduling algorithm time of occurrence is earliest, is basis and the blank of other algorithms.Its basic thought is exactly fixed in advance The better scheduling rule of justice, all requests are allocated according to rule, and the current state with system, such as load capacity, The information such as resource utilization are unrelated.
(2) dynamic dispatching algorithm
For static scheduling, dynamic dispatching algorithm joined some feedback mechanisms, and this mechanism can be dynamically Current cluster information is collected, load including each node, type, quantity, the utilization rate of bandwidth, request delay newly requested Etc..Using these information, we can dynamically change the weight and other some attributes of server, and what change newly connected walks To.Such measure load summit and it is unstable when, good adjustment effect can be played, avoid service tilt and delay The case where machine, occurs, and improves the overall performance of cluster.
Since 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 in the prior art about the angle that the scheme of distribution Service Source is mostly from load balancing, very The rare Resource Allocation Formula for service priority.In the case where Service Source is abundant, since all business can be timely It is assigned to Service Source, priority may be less for the importance of business.However, when Service Source is in short supply, it is not all Business can be assigned to Service Source in time, Service Source just should be preferentially assigned to for core, urgent business, this When, priority for business importance with regard to self-evident.
Summary 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, this method fully consider service priority, according to priority distribute Service Source, right in conventional load balancing technique to solve Service priority considers insufficient problem.
The purpose of the present invention is mainly achieved through the following technical solutions:
Scheduler is arranged in a kind of high concurrent service resource allocation method based on service priority;The scheduler and service Servers-all in device cluster is connected;The scheduler is stored with the mark of Servers-all, forms the clothes of the server cluster Business device identifies queue;
The high concurrent service resource allocation method includes the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, the scheduler are that each service request received 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 Source deficiencies, temporarily When stopping access request, it is transferred to step S4;
Step S4, the scheduler store the service request that unserviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;
Step S6, the time is issued according to service priority and service request, the service request of storage is inserted by scheduler Corresponding position in corresponding service request queue;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, is pressed The chronological order that user issues service request is lined up;
Step S7, the scheduler is according to the service priority in service request queue and the industry in the service request queue The time interval t that the service request queue is retransmitted in business quantity setting specifically meets niti<njtj, wherein i, j indicate that business is asked Queue label is sought, i label service request queue service priority is higher than the service priority of j label service request queue, ni、ti Service request quantity respectively in the queue of i label service request and the time interval for retransmitting the service request queue, nj、tjPoint Service request quantity in j label service request queue and the time interval of the service request queue Wei not be retransmitted;
Step S8, the scheduler are that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue every time t, using polling mode, until this All service requests of service request queue are received by server, terminate the process.
Further, the step S3 includes following sub-step:
Step S301, scheduler Service Source units needed for obtaining the service request in configuration file;Specifically, it uses Service Source units needed for each type of service is stored in configuration file by family, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S302, the scheduler;
Received service request and the required Service Source units got are transmitted to by step S303, the scheduler The server of tail of the queue mark;
Step S304, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required Service Source units of device forwarding;It is that the server receives and handle the service request, terminates the process;It is no, it should Server returns to " business pause access " 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 access " response, goes to step S4.
Further, the service priority is determined by user demand, urgent, significance level of the user according to task, setting Service priority is written in configuration file, is scheduled for device and transfers by service priority.
Further, the step S9 includes following sub-step:
Step S901, scheduler are provided from service needed for first service request of the service request queue is obtained in configuration file Source units;
Team's head element in server identification queue is gone out team and is inserted into 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 requests required Service Source units to be transmitted to the server that tail of the queue identifies;
Step S904, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required resource units number of device forwarding;It is that the server receives and handle first service request, and scheduler should Service request is deleted from business request queue;No, which returns to " business pause access " response to scheduler;
Repeat the above steps S901~S904, until all service requests in the service request queue are connect by server By terminating the process.
Further, scheduler uses two-server to realize with active/standby mode.
The present invention is in order to solve the above technical problems, provide another high concurrent Service Source based on service priority point Method of completing the square, specifically:
Scheduler is set;The scheduler is connected with the Servers-all in server cluster;The scheduler is stored with all The mark of server forms the server identification queue of the server cluster;Scheduler is at regular intervals to Servers-all It inquires Service Source Expenditure Levels, obtains the total resources consumption ratio of server cluster;
The high concurrent service resource allocation method includes the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, scheduler judge that whether the total resources consumption of current server cluster than reaches threshold set by scheduler Value;Judging result is when being, to go to step S5;When judging result is no, S3 is gone to step;
Step S3, the scheduler are that each service request received 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 store the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Business is excellent First grade is determined that user is arranged service priority, service priority is write according to urgent, the significance level of task by user demand Enter in configuration file, is scheduled for device and transfers;
Step S7, the time issued according to service priority and service request, which is inserted into corresponding service Corresponding position in request queue;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, is pressed The chronological order that user issues service request is lined up;
Step S8, the scheduler is according to the service priority in service request queue and the industry in the service request queue The time interval t that the service request queue is retransmitted in business quantity setting specifically meets niti<njtj, wherein i, j indicate that business is asked Queue label is sought, i service request queue service priority is higher than the service priority of j service request queue, 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 request Service request quantity in queue and the time interval for retransmitting the service request queue;
Step S9, the scheduler are that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue every time t, using polling mode, until this All service requests of service request queue are received by server, stop retransmitting the service request queue, terminate the process;
Further, the threshold value is determined by user demand, is arranged according to the actual situation, and setting principle is with excellent to business First grade 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 Service Source units needed for obtaining the service request in configuration file;Specifically, it uses Service Source units needed for each type of service is stored in configuration file by family, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S402, the scheduler;
Step S403, the required Service Source units that the scheduler will acquire are transmitted to the service of tail of the queue mark Device;
Step S404, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required Service Source units of device forwarding;It is that the server receives and handle the service request, terminates the process, it is no, it should Server returns to " business pause access " 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 service needed for obtaining first service request of the service request queue in configuration file Resource units number;
After step S1002, t time interval, team's head element in server identification queue is gone out team and is inserted into team by scheduler Tail;
Step S1003, the scheduler is by Service Source unit needed for first service request 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 judge 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 is asked It asks, corresponding service request is deleted from business request queue;No, then the server returns to " business pause access " to scheduler Response;
Repeat the above steps S1001~S1004, until all service requests in the service request queue are by server Receive, stops retransmitting the service request queue, terminate the process.
The present invention has the beneficial effect that:
1, present invention setting scheduler is high concurrent traffic assignments Service Source, to each business in high concurrent business Request generates a process, one service request of each process independent process.To any bar service request by the way of poll Service Source is distributed, while guaranteeing resource energy relatively uniform distribution, is realized relatively simple.
2, the present invention devises a kind of mechanism that service resource allocation is realized according to service priority, ensure that and provides in service When source is in short supply, the high business of priority can preferentially get Service Source.
3, 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 get Service Source within a certain period of time, be not in that priority is low Business can not all obtain the case where Service Source within a very long time, therefore be very suitable for the scene of high concurrent business
4, by setting threshold value, the allocation strategy based on priority is opened when thinking necessary by user, is guaranteed In Service Source relative deficiency, the business for keeping priority high preferentially gets Service Source.
Other features and advantages of the present invention will illustrate in the following description, also, partial become from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Detailed description of the invention
Attached drawing is only used for showing the purpose of specific embodiment, and is not to be construed as limiting the invention, in entire attached drawing In, identical reference symbol indicates identical component.
Fig. 1 is one flow diagram of the embodiment of the present invention.
Fig. 2 is three flow diagram of the embodiment of the present invention.
Specific embodiment
Specifically describing the preferred embodiment of the present invention with reference to the accompanying drawing, wherein attached drawing constitutes the application a part, and Together with embodiments of the present invention for illustrating the principle of the present invention.
Embodiment one,
Scheduler is arranged before carrying out service resource allocation in the present embodiment;Scheduler can be in server cluster Any server can be individually scheduled, can also processing business request simultaneously.Institute in the scheduler and server cluster There is server to be connected;The scheduler is stored with the mark of Servers-all, forms the server identification queue of the server cluster. Scheduler is realized using a high performance network server with muti-piece network interface card.In order to improve fault-tolerance, using active/standby mode, Realize that dual-locomotive heat back-up (is simultaneously deployed to set of system on two-server, if host system goes out with two-server Existing failure, then be immediately switched to run on standby host).
The high concurrent service resource allocation method based on service priority that present embodiment discloses a kind of, as shown in Figure 1,
Include the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, the scheduler are that each service request received 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 Source deficiencies, temporarily When stopping access request, it is transferred to step S4;
Including following sub-step:
Step S301, scheduler Service Source units needed for obtaining the service request in configuration file;Specifically, it uses Service Source units needed for each type of service is stored in configuration file by family, is scheduled for device acquisition;
Demand of the different business to Service Source is different, assigns a Service Source units, such as a industry to every kind of business Be engaged in it is smaller to resources requirement, assign the Service Source of its 1 unit, b business is slightly larger to Service Source demand, assign its 2 The resource of a unit concurrently sets the total resource units number of server, and when being set as 10000 units, server can be simultaneously The most 10000 a service requests of concurrent processing perhaps 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 is inserted into tail of the queue by step S302, the scheduler;
Received service request and the required Service Source units got are transmitted to by step S303, the scheduler The server of tail of the queue mark;
Step S304, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required Service Source units of device forwarding;It is that the server receives and handle the service request, terminates the process, it is no, it should Server returns to " business pause access " 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 access " response, is transferred to step S4.
Step S4, the scheduler store the service request that unserviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;Business is excellent First grade is determined by user demand, and according to urgent, the significance level of task, service priority is arranged, and service priority write-in is matched It sets in file, is scheduled for device and transfers;
When Service Source is relatively abundant, different business is not obvious 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 meet all business in time, this When, the priority of resource allocation is just particularly important.Business urgent for those, important, core needs to assign Their relatively high priority guarantee 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 issued according to service priority and service request, the service request of storage is inserted by scheduler Corresponding position in corresponding service request queue;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, is pressed The chronological order that user issues service request is lined up;
Step S7, scheduler is according to the service priority in service request queue and the business number in the service request queue The time interval t that the service request queue is retransmitted in amount setting specifically meets niti<njtj, wherein i, j indicate service request team Column label, i label service request queue service priority are higher than the service priority of j label service request queue, ni、tiRespectively For the service request quantity in i label service request queue and retransmit the time interval of the service request queue, nj、tjRespectively j Service request quantity in label service request queue and the time interval for retransmitting the service request queue;
Step S8, the scheduler are that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue every time t, using polling mode, until this All service requests of service request queue are received by server, terminate the process;Including following sub-step:
Step S901, scheduler are provided from service needed for first service request of the service request queue is obtained in configuration file Source units;
Team's head element in server identification queue is gone out team and is inserted into 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 requests required Service Source units to be transmitted to the server that tail of the queue identifies;
Step S904, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required resource units number of device forwarding;It is that the server receives and handle first service request, and scheduler should Service request is deleted from business request queue;No, which returns to " business pause access " response to scheduler;
Repeat the above steps S901~S904, until all service requests in the service request queue are connect by server By terminating the process.
The working condition of server, which is divided into, in the present embodiment cluster loads less than, two states of full load.It loads less than, refers to Be in cluster there are also not up to full load server.If individual server has reached the peak load of work, i.e., full Load, will refuse new request, when server all runnings at full capacity all in cluster, then entire cluster is in full load State can not handle new request.When cluster load is less than, priority is not distinguished between different business, i.e., scheduler is with identical Priority is that different business distributes Service Source.At this point, scheduler uses the mode of polling dispatching for each traffic assignments clothes Business resource.If response that all servers all return in dispatcher queue " business pause access ", illustrates server set at this time Group has been in full load state, then enters the full load stage.When cluster is in full load state, Service Source has been in deficient Weary state, the request of scheduler are illustrated not available in cluster by after Servers-all response " business pause access " Service Source.
The present embodiment thinks highly of the frequency (i.e. time interval) of sending service request by configuration scheduling to control Service Source Distribution.Specifically, when scheduler discovery server cluster has reached full load, current service request can temporarily be stored Get off, t retransmits the request at regular intervals, just stops retransmitting until the request is received.At this point, if there is several inhomogeneities The business of type is in contention Service Source, in order to allow more urgent, important, core business to be preferentially quickly distributed to service money Source can retransmit scheduler the high of the frequency setting of the type service request, i.e., the time interval t's for retransmitting the request Value is set smaller.
Embodiment two,
For ease of understanding, one is provided specifically with example.
In core communication system, the calculating service provided using calculation server cluster is required there are three types of business, Priority is respectively crucial control business, operational administrative business, general inquiry business from high to low.
Assuming that calculation server cluster is made of 10 single calculation servers, and externally provide access controller ServController is responsible for receiving the business of forwarding user terminal by ServController as unified access point, that is, scheduler It requests to be handled 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 access " to ServController and rings It answering, ServController is used according to calculation server next in return value selective listing, and so on, when in list All calculation servers all polls one time and in the case where all returning to " business pause access ", ServController is temporarily deposited The business request information is stored up, reselects calculation server after being spaced n seconds time.
For all calculation servers all in the case where at full capacity, ServController activates preferential fraction automatically at this time With strategy, preferentially got by setting the size of different business retransmittal interval n automatically to control the business of high priority Computing resource is handled.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 access ", at this point, 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 at first calculates Service Source;After 2s, another calculation server is from completely Load becomes idle, and exists without the business of higher priority of resource allocation, and operational administrative business can be obtained meter at this time Calculate Service Source.Obviously, in this way, the higher business of priority of resource allocation can preferentially be obtained in contention for resources Service Source, the low business of priority will not can not all obtain Service Source within a very long time.
Embodiment three,
Above-described embodiment one, two in server cluster full load, is just opened based on priority distribution service money Source present embodiments provides a kind of preferential based on threshold value unlatching to make urgent, important business obtain service resources faster The example of grade distribution Service Source.
The high concurrent service resource allocation method based on service priority that present embodiment discloses a kind of, scheduler is every one It fixes time and inquires Service Source Expenditure Levels to Servers-all, the total resources consumption ratio of server cluster is obtained, when total money When threshold of the source consumption than reaching scheduler setting, illustrate that Service Source is not abundant enough at this time, 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 High service request, then the lower service request of forwarding priority.
As shown in Fig. 2, including the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, scheduler judge that whether the total resources consumption of current server cluster than reaches threshold set by scheduler Value;Judging result is when being, to go to step S5;When judging result is no, S3 is gone to step;The threshold value determines by user demand, according to Actual conditions setting, with the increase for stressing degree to service priority, reduces the threshold value;Optimal threshold is 75%, that is, is existed Resource consumption ratio reach 75% or more Service Source it is relatively nervous when open priority allocation strategy, dispatched with guaranteeing to increase Device program considers that priority distributes the equilibrium of both Service Sources.
Step S3, the scheduler are that each service request received 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 Service Source units needed for obtaining the service request in configuration file;Specifically, it uses Service Source units needed for each type of service is stored in configuration file by family, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S402, the scheduler;
Step S403, the required Service Source units that the scheduler will acquire are transmitted to the service of tail of the queue mark Device;
Step S404, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to tune Spend the required Service Source units of device forwarding;It is that the server receives and handle the service request, terminates the process, it is no, it should Server returns to " business pause access " response to scheduler;
Repeat the above steps S401~S404, until there is a server to receive the service request.
Step S5, the scheduler store the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Business is excellent First grade is determined that user is arranged service priority, service priority is write according to urgent, the significance level of task by user demand Enter in configuration file, is scheduled for device and transfers;
Step S7, the time issued according to service priority and service request, which is inserted into corresponding service Corresponding position in request queue;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, is pressed The chronological order that user issues service request is lined up;
Step S8, scheduler is according to the service priority in service request queue and the business number in the service request queue The time interval t that the service request queue is retransmitted in amount setting specifically meets niti<njtj, wherein i, j indicate service request team Column label, i label service request queue service priority are higher than the service priority of j label service request queue, ni、tiRespectively For the service request quantity in i label service request queue and retransmit the time interval of the service request queue, nj、tjRespectively j Service request quantity in label service request queue and the time interval for retransmitting the service request queue;
Step S9, the scheduler are that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue every time t, using polling mode, until this All service requests of service request queue are received by server, stop retransmitting the service request queue, terminate the process;Including Following sub-step:
Step S1001, scheduler service needed for obtaining first service request of the service request queue in configuration file Resource units number;
After step S1002, t time interval, team's head element in server identification queue is gone out team and is inserted into team by scheduler Tail;
Step S1003, the scheduler is by Service Source unit needed for first service request 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 judge 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 is asked It asks, corresponding service request is deleted from business request queue;No, then the server returns to " business pause access " to scheduler Response;
Repeat the above steps S1001~S1004, until all service requests in the service request queue are by server Receive, stops retransmitting the service request queue, terminate the process.
The invention has the following advantages that
1, the present invention uses the mode of poll for high concurrent traffic assignments Service Source, is guaranteeing that resource can be relatively uniform point With while, realize it is relatively simple.
2, the present invention devises a kind of resource allocation mechanism by service priority, ensure that relatively in short supply in Service Source When, the high business of priority can preferentially get Service Source.
3, 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 get Service Source within a certain period of time, be not in that priority is low Business can not all obtain the case where 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 realizing all or part of the process of above-described embodiment method, meter can be passed through Calculation machine program is completed to instruct relevant hardware, and the program can be stored in computer readable storage medium.Wherein, institute Stating computer readable storage medium is disk, CD, read-only memory or random access memory etc..
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by anyone skilled in the art, It should be covered by the protection 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: setting scheduler;The scheduling Device is connected with the Servers-all in server cluster;The scheduler is stored with the mark of Servers-all, forms the server The server identification queue of cluster;
The high concurrent service resource allocation method includes the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, the scheduler are that each service request received generates a process;
Step S3, the scheduler using the received service request of polling mode forwarding to server, when there is server clothes Resource of being engaged in is sufficient, and when receiving the service request, corresponding process terminates;When Servers-all all Service Sources are insufficient, pause is connect When entering to request, it is transferred to step S4;
Step S4, the scheduler store the service request that unserviced device receives;
Step S5, the service priority of scheduler service request of calling stored from configuration file;Service priority It is determined by user demand, service priority is arranged according to urgent, the significance level of task in user, and service priority write-in is matched It sets in file, is scheduled for device and transfers;
Step S6, the time is issued according to service priority and service request, the service request of storage is inserted into accordingly by scheduler Service request queue in corresponding position;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, by user The chronological order for issuing service request is lined up;
Step S7, the scheduler are asked according to the service priority in service request queue and the business in the service request queue The time interval t for asking quantity setting to retransmit the service request queue specifically meets niti<njtj, wherein i, j indicate that business is asked Queue label is sought, i service request queue service priority is higher than the service priority of j service request queue, 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 request Service request quantity in queue and the time interval for retransmitting the service request queue;
Step S8, the scheduler are that every service request queue generates a process;
Step S9, the scheduler retransmits corresponding service request queue every time t, using polling mode, until the business All service requests of request queue are received by server, 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 Service Source units needed for obtaining the service request in configuration file;Specifically, user will Service Source units needed for each type of service is stored in configuration file, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S302, the scheduler;
Received service request and the required Service Source units got are transmitted to tail of the queue by step S303, the scheduler The server of mark;
Step S304, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to scheduler The required Service Source units of forwarding;It is that the server receives and handle the service request, terminates the process, no, the service Device returns to " business pause access " 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 access " 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 determines, according to urgent, the significance level of task, service priority is arranged, service priority is written in 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 Service Source list needed for obtaining first service request of the service request queue in configuration file Digit;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S902, scheduler;
After step S903, t time interval, the scheduler asks first service request and the business in the service request queue Required Service Source units is asked to be transmitted to the server of tail of the queue mark;
Step S904, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to scheduler The required resource units number of forwarding;It is that the server receives and handle first service request, scheduler is by the business Request is deleted from business request queue;No, which returns to " business pause access " response to scheduler;
Repeat the above steps S901~S904, until all service requests in the service request queue are received by server, 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: setting scheduler;The scheduling Device is connected with the Servers-all in server cluster;The scheduler is stored with the mark of Servers-all, forms the server The server identification queue of cluster;Scheduler inquires Service Source Expenditure Levels to Servers-all at regular intervals, obtains The total resources of server cluster consume ratio;
The high concurrent service resource allocation method includes the following steps:
Step S1, scheduler receive the service request that user issues;
Step S2, scheduler judge that whether the total resources consumption of current server cluster than reaches threshold value set by scheduler; Judging result is when being, to go to step S5;When judging result is no, S3 is gone to step;
Step S3, the scheduler are that each service request received generates a process;
Step S4, the scheduler using the received service request of polling mode forwarding to server, when there is server clothes Resource of being engaged in is sufficient, and when receiving the service request, corresponding process terminates;
Step S5, the scheduler store the service request;
Step S6, the service priority of scheduler service request of calling stored from configuration file;Service priority It is determined by user demand, service priority is arranged according to urgent, the significance level of task in user, and service priority write-in is matched It sets in file, is scheduled for device and transfers;
Step S7, the service request is inserted into corresponding service request by the time issued according to service priority and service request Corresponding position in queue;
Specifically, service request queue is made of the identical service request of priority, in each service request queue, by user The chronological order for issuing service request is lined up;
Step S8, the scheduler are asked according to the service priority in service request queue and the business in the service request queue The time interval t for asking quantity setting to retransmit the service request queue specifically meets niti<njtj, wherein i, j indicate that business is asked Queue label is sought, i service request queue service priority is higher than the service priority of j service request queue, 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 request Service request quantity in queue and the time interval for retransmitting the service request queue;
Step S9, the scheduler are that every service request queue generates a process;
Step S10, the scheduler retransmits corresponding service request queue every time t, using polling mode, until the business All service requests of request queue are received by server, 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 demand It determines, is arranged according to the actual situation, setting principle is to reduce the threshold value with the increase for stressing service priority degree.
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 Service Source units needed for obtaining the service request in configuration file;Specifically, user will Service Source units needed for each type of service is stored in configuration file, is scheduled for device acquisition;
Team's head element in server identification queue is gone out team and is inserted into tail of the queue by step S402, the scheduler;
Step S403, the required Service Source units that the scheduler will acquire are transmitted to the server of tail of the queue mark;
Step S404, the server of the tail of the queue mark judge whether self residual Service Source units is more than or equal to scheduler The required Service Source units of forwarding;It is that the server receives and handle the service request, terminates the process;It is no, the service Device returns to " business pause access " 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 includes such as Lower sub-step:
Step S1001, scheduler Service Source needed for obtaining first service request of the service request queue in configuration file Units;
After step S1002, t time interval, team's head element in server identification queue is gone out team and is inserted into tail of the queue by scheduler;
Step S1003, the scheduler turn Service Source units needed for first service request in the service request queue Issue the server of tail of the queue mark;
Step S1004, the server of the tail of the queue mark judge whether self residual Service Source units is 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 access " response to scheduler;
Repeat the above steps S1001~S1004, until all service requests in the service request queue are connect by server By the service request queue is retransmitted in stopping, terminating the process.
CN201611187880.3A 2016-12-20 2016-12-20 A kind of high concurrent service resource allocation method based on service priority Active CN106789726B (en)

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 CN106789726A (en) 2017-05-31
CN106789726B true 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)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
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
CN108124003B (en) * 2017-12-11 2021-03-26 中盈优创资讯科技有限公司 Network management equipment connection processing method, device and system
CN108111499B (en) * 2017-12-15 2021-07-16 腾讯科技(深圳)有限公司 Business processing performance optimization method and 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
CN108303688B (en) * 2018-04-27 2022-02-11 北京东远润兴科技有限公司 Reconstruction system and method for radar signal processing and radar system
CN110971533B (en) * 2018-09-30 2023-02-03 京东方科技集团股份有限公司 Method, server apparatus, client apparatus, and medium for data communication
US10911568B2 (en) * 2018-10-03 2021-02-02 Twitter, Inc. Client software back off
CN109492926A (en) * 2018-11-22 2019-03-19 中国银行股份有限公司 A kind of transaction dispatcher method and system based on preferential level adaptation
CN110086848B (en) * 2019-03-15 2023-07-21 安徽银柏电子科技有限公司 Network request sending method and device, computer equipment and storage medium
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
CN113239061B (en) * 2021-05-31 2023-02-10 浙江环玛信息科技有限公司 Intelligent court data updating method and system
CN113467909B (en) * 2021-06-29 2022-03-15 贝壳找房(北京)科技有限公司 Time consuming method and apparatus for compressing concurrent requests
CN116208680B (en) * 2023-05-04 2023-07-14 成都三合力通科技有限公司 Server access management system and method
CN117112239B (en) * 2023-10-23 2024-02-09 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) Extensible load balancing method and system on heterogeneous reasoning back end

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN106789726A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106789726B (en) A kind of high concurrent service resource allocation method based on service priority
CN107066319B (en) Multi-dimensional scheduling system for heterogeneous resources
CN103856393B (en) Distributed message middleware system and its operation method based on database
CN1744575B (en) Method for improving quality-of-service management in networks
JP5324637B2 (en) Dynamic flowlet scheduling system, flow scheduling method, and flow scheduling program
EP2944072B1 (en) System for service allocation
CN101873005B (en) Method for realizing balanced acquisition of electric energy
CN108616458A (en) The system and method for schedule packet transmissions on client device
US20130290526A1 (en) Network assisted power management
CN101257445A (en) Method for synchronous traffic shaping
CN103079273A (en) Resource management method suitable for multilayer satellite system
CN103927225A (en) Multi-core framework Internet information processing and optimizing method
CN109088829A (en) A kind of data dispatching method, device, storage medium and equipment
Khalifa¹ et al. Collaborative autonomic resource management system for mobile cloud computing
CN112565774A (en) Video transcoding resource scheduling method and device
CN109783225A (en) A kind of tenant&#39;s priority management method and system of multi-tenant big data platform
CN109962760A (en) A kind of business scheduling method suitable for wireless TDMA ad hoc network
CN105515791A (en) Ethernet method and use method in ethernet device
CN108282526B (en) Dynamic allocation method and system for servers between double clusters
Wen et al. Load balancing job assignment for cluster-based cloud computing
CN107122235A (en) Public infrastructure resource regulating method based on application priority
Lu et al. An efficient load balancing algorithm for heterogeneous grid systems considering desirability of grid sites
CN101867580B (en) Method for allocating network flow and device
CN105873223A (en) Service scheduling method, service scheduling device, wireless network controller and base station
CN109714223B (en) System and method for realizing network service access dynamic load sharing function under NFV architecture

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