CN115858204A - RPC request scheduling processing method, system and medium based on fairness algorithm - Google Patents

RPC request scheduling processing method, system and medium based on fairness algorithm Download PDF

Info

Publication number
CN115858204A
CN115858204A CN202310139306.4A CN202310139306A CN115858204A CN 115858204 A CN115858204 A CN 115858204A CN 202310139306 A CN202310139306 A CN 202310139306A CN 115858204 A CN115858204 A CN 115858204A
Authority
CN
China
Prior art keywords
rpc
request
requests
preset
rpc request
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.)
Pending
Application number
CN202310139306.4A
Other languages
Chinese (zh)
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.)
XCMG Hanyun Technologies Co Ltd
Original Assignee
XCMG Hanyun Technologies 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 XCMG Hanyun Technologies Co Ltd filed Critical XCMG Hanyun Technologies Co Ltd
Priority to CN202310139306.4A priority Critical patent/CN115858204A/en
Publication of CN115858204A publication Critical patent/CN115858204A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses an RPC request scheduling processing method, a system and a medium based on a fairness algorithm, belonging to the technical field of computer resource allocation scheduling, wherein the method comprises the following steps: receiving an RPC request sent from the outside; responding to the received RPC requests when a FairCallQueue function is in an open state, calculating the priority value of each RPC request through a fairness algorithm, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset division range; and taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests, and finishing RPC request scheduling processing. The invention reasonably allocates the RPC requests by queues, thereby realizing reasonable allocation of resources, and improving the performance and the use experience of the cluster with multiple users, large difference of request quantity and unbalanced resource allocation.

Description

RPC request scheduling processing method, system and medium based on fairness algorithm
Technical Field
The invention relates to a RPC request scheduling processing method, a system and a medium based on a fairness algorithm, belonging to the technical field of computer resource allocation scheduling.
Background
With the wide application of the distributed cluster, cluster resources are shared and used among all request sending ends, the default scheduling mode is First In First Out (FIFO), namely after the queue resources are completely occupied, and after a task is finished, the subsequent RPC request can be executed; when cluster resources are occupied by a large number of long-duration RPC (Remote Procedure Call) requests of a certain request sending end, the other request sending ends cannot obtain the resources, and even a small short-duration RPC request still needs to wait for a long time to obtain the resources.
In the traditional cluster resource FIFO allocation scheduling mode, only one task execution queue exists, resources are occupied by some active request sending ends with large request quantity, and the situation that other request sending ends with small request quantity cannot acquire the resources in time to execute tasks occurs, so that the resources are unevenly allocated or unreasonably used.
Disclosure of Invention
The invention aims to provide an RPC request scheduling processing method, system and medium based on a fairness algorithm, and solves the problems of uneven resource distribution, unreasonable resource use and the like in the prior art.
In order to realize the purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a RPC request scheduling processing method based on a fairness algorithm, including:
receiving an RPC request sent from the outside;
in a state that a FairCallQueue function is started, responding to the received RPC requests, counting the number of the RPC requests of each request sending end according to the Map mapping relation between the request sending end and the number of the RPC requests, calculating the proportion of the number of the RPC requests of each request sending end to the number of all the RPC requests, taking the proportion as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
and taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests, and finishing RPC request scheduling processing.
With reference to the first aspect, further, dividing each RPC request into a plurality of preset queues according to the priority value and a preset division range includes:
and comparing the priority value with a preset division range to obtain a division range where the priority value is located, and dividing the RPC request into corresponding queues through the division range.
With reference to the first aspect, further, the method further includes:
in the state that the FairCallQueue function is not started, if an RPC request is received, the RPC request is placed into an FIFO queue;
and executing the tasks according to the RPC requests in the FIFO queue, and finishing the scheduling processing of the RPC requests.
With reference to the first aspect, further, the method further includes: and outputting the result of executing the task to the request sending end.
With reference to the first aspect, further, the RPC request is obtained by:
and receiving the RPC request sent by the request sending end through the monitoring node.
With reference to the first aspect, further, the multiplexer takes out a preset number of RPC requests from each queue according to the order in which the RPC requests are divided into each queue.
In a second aspect, the present invention further provides a system for processing RPC request scheduling based on a fairness algorithm, including:
RPC request receiving module: the RPC server is used for receiving an externally sent RPC request;
RPC request divides module: the RPC request counting and dividing system is used for responding to the received RPC requests under the state that a FairCallQueue function is started, counting the RPC request number of each request sending end according to the Map mapping relation between the request sending end and the RPC request number, calculating the proportion of the RPC request number of the request sending end corresponding to each RPC request to all the RPC request numbers, taking the proportion as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
a task execution module: and the RPC scheduling system is used for taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests and finishing RPC request scheduling processing.
In a third aspect, the invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspect.
Compared with the prior art, the invention has the following beneficial effects:
according to the RPC request scheduling processing method, system and medium based on the fairness algorithm, an original task execution queue is changed into a plurality of queues, the RPC requests are divided into the plurality of preset queues according to the priority values and the preset division ranges of the RPC requests, and the queues of the RPC requests are reasonably distributed, so that reasonable distribution of resources is achieved, and the condition that other request sending ends with small request quantity cannot timely acquire resource execution tasks due to the fact that the resources are occupied by some active request sending ends with large request quantity is avoided;
the RPC requests are divided through comprehensive calculation of indexes such as the number of the RPC requests and the priority value of the RPC requests, and the RPC requests are reasonably distributed to each queue, so that reasonable distribution of resources is achieved.
Drawings
FIG. 1 is a flowchart of a RPC request scheduling processing method based on a fairness algorithm according to an embodiment of the present invention;
FIG. 2 is a flow chart of the FIFO RPC request processing according to the embodiment of the present invention;
FIG. 3 is a flow chart of the FairCallQueue form RPC request processing provided by the embodiment of the present invention;
fig. 4 is a second flowchart of the RPC request scheduling processing method based on the fairness algorithm according to the embodiment of the present invention.
Detailed Description
The present invention is further described with reference to the accompanying drawings, and the following examples are only for clearly illustrating the technical solutions of the present invention, and should not be taken as limiting the scope of the present invention.
Example 1
As shown in fig. 1, the RPC request scheduling processing method based on the fairness algorithm according to the embodiment of the present invention includes:
firstly, configuring cluster parameters, including starting a FairCallQueue function, the number of queues, the number of RPC requests taken out of each queue each time, a dividing threshold value of RPC request number ratio, a scheduler and a multiplexer.
In this embodiment, the number of configured queues in the cluster configuration file is 4, the number of RPC requests taken out each time in each queue is configured to be 8, 4, 2, and 1, and the division threshold for configuring the ratio of the number of RPC requests is 13, 25, and 50, so that the division ranges are 0-12%, 13-24%, 25-49%, and 50-100%.
And starting the cluster after the configuration of the cluster parameters is completed.
S1, receiving an RPC request sent from the outside.
And receiving the RPC request of the request sending end through the monitoring node.
S2, in a state that a FairCallQueue function is started, in response to the reception of the RPC requests, calculating the priority value of each RPC request through a fairness algorithm, namely counting the number of the RPC requests of each request sending end according to the Map mapping relation between the request sending ends and the number of the RPC requests, calculating the proportion of the number of the RPC requests of the request sending ends corresponding to each RPC request to the number of all the RPC requests, taking the proportion as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range.
Judging whether a cluster starts a FairCallQueue function, if the FairCallQueue function is not started, putting the RPC request acquired in the step S1 into an FIFO queue, and sending the RPC request to an actuator by the FIFO queue; and if the FairCallQueue function is started, sending the RPC request to the FairSchedule configured in the step S1.
After the scheduler receives an RPC request, the RPC request number of each request sending end is counted according to the Map mapping relation between the request sending end and the RPC request quantity, and then the proportion of the RPC request number of the current RPC request sender (the request sending end corresponding to the current RPC request) to all the RPC request numbers is calculated, wherein the proportion is the priority value of the RPC request.
And comparing the priority value with the division range set in the step S1 to obtain the division range where the priority value is located, and dividing the RPC request into corresponding queues through the division range.
And S3, taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests, and finishing RPC request scheduling processing.
And the multiplexer configured in the step S1 polls and takes out 8, 4, 2 and 1 total 15 RPC requests from 4 queues in sequence, the taking-out sequence is the sequence of dividing the RPC requests into each queue, and the RPC requests are sent to the executor after being taken out.
As shown in fig. 3, if the executor receives the RPC request sent in step S3, it executes a specific task accordingly, outputs a task result, and sends the result of executing the task to the request sending end.
As shown in fig. 2, the executor can also receive the RPC request sent by the FIFO queue in step S2, execute a specific task according to the RPC request, output a task result, and send the result of executing the task to the request sending end.
Example 2
The RPC request scheduling processing method based on the fairness algorithm provided by the embodiment of the invention can be used for scheduling RPC requests according to the flow chart shown in figure 4, and comprises the following steps:
(1) Configuring cluster parameters, including starting a FairCallQueue function, the number of queues, the number of RPC requests taken out of each queue each time, a partition threshold value of the ratio of the number of RPC requests, a scheduler and a multiplexer, the following form can be obtained, and the configuration of FairCallQueue is related to:
<property>
< | Using a fair call queue >
<name>ipc. callqueue. impl</ name>
<value>FairCallQueue</ value>
</ property>
<property>
4- | - -, the number of queues
<name>ipc. scheduler. queue. num</ name>
<value>4</ value>
</ property>
<property>
< | the number of RPC's sequentially taken out from a queue >
<name>ipc. faircallqueue. multiplexer. weights</ name>
<value>8,4,2,1</ value>
</ property>
<property>
<! -dividing threshold value of RPC number ratio >
<name>ipc. num-scheduler. thresholds</ name>
<value>13,25,50</ value>
</ property>
<property>
< | Using FairSchedule scheduler >
<name>ipc. scheduler. impl</ name>
<value>FairScheduler</ value>
</ property>
<property>
< | multiplexer >
<name>ipc. scheduler. multiplexer. impl</ name>
<value>WeightedRoundRobinMultiplexer</ value>
</ property>
It can be seen from the above configuration that the number of queues is 4, the number of RPC requests taken out each time in each queue is 8, 4, 2, 1, respectively, and the division threshold of the RPC request number ratio is 13, 25, 50, the division range is 0-12%, 13-24%, 25-49%, 50-100%.
(2) The cluster is started and a number of RPC requests are received by the listening node requesting the sender (i.e., the program/user in fig. 4).
(3) And (4) the monitoring node judges whether to start a FairCallQueue function according to the configured ipc.
(4) If the detection result in the step (3) is that the RPC request is not started, the monitoring node puts the received RPC request into an FIFO queue, and the flow refers to a traditional FIFO form RPC request processing flow chart shown in FIG. 2.
(5) If the detection result in the step (3) is that the system is started, the listening node sends the received RPC request to the scheduler ipc, scheduler, impl configured in the step (1), and the flow refers to a faircall form RPC request processing flow chart shown in fig. 3.
(6) Scheduling, allocating and allocating a scheduler ipc, scheduling, and allocating the RPC request in the step (1) to obtain a priority value of the current RPC request according to a fairness algorithm, namely counting the request number of each program/user according to a Map mapping relation of (a request sending end and an RPC request amount), and calculating the ratio of the request number of a current RPC request sender to all the request numbers.
(7) And comparing the priority value with the division range set in the step S1 to obtain the division range where the priority value is located, and dividing the RPC request into corresponding queues through the division range.
(8) And (3) sequentially polling 4 queues of the ipc, schedule, queue and num configured in the step (1) by the multiplexer ipc, schedule, multiplexer and estimate configured in the step (1) to take out 8, 4, 2 and 1 RPC requests in total.
(9) The executor receives the RPC request fetched from step (4) or step (8), executes a specific request task, and returns the result to the request sender (i.e., the program/user in fig. 4).
Example 3
The RPC request scheduling processing system based on the fairness algorithm provided by the embodiment of the invention comprises:
RPC request receiving module: the RPC server is used for receiving an externally sent RPC request;
RPC request divides module: the RPC request counting system is used for responding to the received RPC requests in a state that a FairCallQueue function is started, counting the number of the RPC requests of each request sending end according to the Map relation between the request sending end and the number of the RPC requests, calculating the ratio of the number of the RPC requests of each request sending end to the number of all the RPC requests, taking the ratio as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
a task execution module: and the RPC scheduling system is used for taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests and finishing RPC request scheduling processing.
Example 4
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the following method:
receiving an RPC request sent from the outside;
in a state that a FairCallQueue function is started, responding to the received RPC requests, counting the number of the RPC requests of each request sending end according to the Map mapping relation between the request sending end and the number of the RPC requests, calculating the proportion of the number of the RPC requests of each request sending end to the number of all the RPC requests, taking the proportion as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
and taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests, and finishing RPC request scheduling processing.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (8)

1. The RPC request scheduling processing method based on the fairness algorithm is characterized by comprising the following steps:
receiving an RPC request sent from the outside;
in a state that a FairCallQueue function is started, responding to the received RPC requests, counting the number of the RPC requests of each request sending end according to the Map mapping relation between the request sending end and the number of the RPC requests, calculating the proportion of the number of the RPC requests of each request sending end to the number of all the RPC requests, taking the proportion as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
and taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests, and finishing RPC request scheduling processing.
2. The RPC request scheduling processing method based on fairness algorithm of claim 1, wherein dividing each RPC request into a plurality of preset queues according to the priority value and the preset division range includes:
and comparing the priority value with a preset division range to obtain a division range where the priority value is located, and dividing the RPC request into corresponding queues through the division range.
3. The RPC request scheduling processing method based on fairness algorithm of claim 1, further comprising:
in the state that the FairCallQueue function is not started, if an RPC request is received, the RPC request is placed into an FIFO queue;
and executing the tasks according to the RPC requests in the FIFO queue, and finishing the scheduling processing of the RPC requests.
4. The RPC request scheduling processing method based on fairness algorithm of claim 1, further comprising: and outputting the result of the executed task to the request sending terminal.
5. The RPC request scheduling processing method based on fairness algorithm of claim 1, wherein the RPC request is obtained by the following method:
and receiving the RPC request sent by the request sending end through the monitoring node.
6. The method of claim 1, wherein the multiplexer fetches a predetermined number of RPC requests from each queue in the order in which the RPC requests are divided into the queues.
7. RPC request scheduling processing system based on fair algorithm, which is characterized by comprising:
RPC request receiving module: the RPC server is used for receiving an externally sent RPC request;
RPC request divides module: the RPC request counting system is used for responding to the received RPC requests in a state that a FairCallQueue function is started, counting the number of the RPC requests of each request sending end according to the Map relation between the request sending end and the number of the RPC requests, calculating the ratio of the number of the RPC requests of each request sending end to the number of all the RPC requests, taking the ratio as the priority value of the RPC requests, and dividing each RPC request into a plurality of preset queues according to the priority value and a preset dividing range;
a task execution module: and the RPC scheduling system is used for taking out a preset number of RPC requests from each queue, executing tasks according to the taken-out RPC requests and finishing RPC request scheduling processing.
8. Computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202310139306.4A 2023-02-21 2023-02-21 RPC request scheduling processing method, system and medium based on fairness algorithm Pending CN115858204A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310139306.4A CN115858204A (en) 2023-02-21 2023-02-21 RPC request scheduling processing method, system and medium based on fairness algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310139306.4A CN115858204A (en) 2023-02-21 2023-02-21 RPC request scheduling processing method, system and medium based on fairness algorithm

Publications (1)

Publication Number Publication Date
CN115858204A true CN115858204A (en) 2023-03-28

Family

ID=85658496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310139306.4A Pending CN115858204A (en) 2023-02-21 2023-02-21 RPC request scheduling processing method, system and medium based on fairness algorithm

Country Status (1)

Country Link
CN (1) CN115858204A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298539A (en) * 2011-06-07 2011-12-28 华东师范大学 Method and system for scheduling shared resources subjected to distributed parallel treatment
US20170034310A1 (en) * 2015-07-29 2017-02-02 Netapp Inc. Remote procedure call management

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298539A (en) * 2011-06-07 2011-12-28 华东师范大学 Method and system for scheduling shared resources subjected to distributed parallel treatment
US20170034310A1 (en) * 2015-07-29 2017-02-02 Netapp Inc. Remote procedure call management

Similar Documents

Publication Publication Date Title
CN109246229B (en) Method and device for distributing resource acquisition request
CN107423120B (en) Task scheduling method and device
CN107800768B (en) Open platform control method and system
CN108268317B (en) Resource allocation method and device
CN107977302B (en) CPU utilization rate output method and device
WO2019006907A1 (en) Systems and methods for allocating computing resources in distributed computing
CN110912992B (en) Diagnostic data transmission method, device, equipment and system
CN112379994B (en) Multidimensional electricity data acquisition and scheduling method and system
CN111343275B (en) Resource scheduling method and system
CN109426554B (en) Timing implementation method and device for server
CN115858204A (en) RPC request scheduling processing method, system and medium based on fairness algorithm
CN117032977A (en) Mixed part application resource allocation method and device, computer equipment and storage medium
CN113051064A (en) Task scheduling method, device, equipment and storage medium
CN111124672A (en) Data distribution method based on Redis cluster and related equipment
CN109428901B (en) Message processing method and message processing device
CN114020433A (en) Instance resource scheduling method, device, storage medium and device
CN111355751A (en) Task scheduling method and device
US8869171B2 (en) Low-latency communications
CN111258729B (en) Redis-based task allocation method and device, computer equipment and storage medium
CN109379605B (en) Bullet screen distribution method, device, equipment and storage medium based on bullet screen sequence
CN109062706B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN109062707B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN109933426B (en) Service call processing method and device, electronic equipment and readable storage medium
CN116137613A (en) Data scheduling method, system, device and computer readable storage medium
CN110941493A (en) Task scheduling method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230328