Task scheduling method and device

A job scheduling and job technology, applied in the field of distributed computing, can solve the problems of inability to wait for resources, distributed system consumption, reduce distributed system throughput and resource utilization, etc., to improve rationality, throughput and resources. Utilization, the effect of improving processing efficiency and resource utilization

Active Publication Date: 2018-08-24
ALIBABA GRP HLDG LTD
11 Cites 1 Cited by

AI-Extracted Technical Summary

Problems solved by technology

But in fact, a job is likely to get enough resources within a short period of time after the upper limit of the waiting time, and switching to offline mode may consume more resources than waiting for a short period of time in online mode. time and resources
Even if the same job is submitted at different time points, if there are many jobs in the waiting queue at that time, it is very likely that the resources will not be available after waiting...
View more

Method used

Concretely, can obtain the task end moment of described unfinished task according to the running time of unfinished task and the current time point; According to the number of instances of described unfinished task and the running status of each instance, obtain described The number of unfinished running instances in the unfinished task, and the number of releasable resources of the unfinished task is determined based on the number of unfinished running instances in the unfinished task. In this embodiment, the number of resources that can be released after the end of the task is estimated based on the number of instances in the task, and the accuracy is higher.
[0084] In some implementations, the first time point can be re-estimated regularly; the first time point and the upper limit of the waiting time of the first job can be re-compared regularly, so that the waiting time of jobs in the waiting queue can be real-time Adjusting the status is beneficial to improve the processing efficiency and resource utilization of the distributed system.
[0105]...
View more

Abstract

Provided are a task scheduling method and device. The method comprises the following steps: estimating a first time point when available resources meet a first operation requirement according to taskinformation of all tasks before first operation as for the first operation in a waiting queue under an online mode; comparing waiting time limit of the first time point and the first operation; and shifting the first operation to be operated in an off-line mode when the waiting time limit of the first time point is larger than that of the first operation. Tasks can be reasonably scheduled according to operation conditions of the tasks in the waiting queue and operation conditions of other operations in the waiting state, thereby fulfilling the purposes of increasing the throughput rate and theresources utilization rate of a distributed system.

Application Domain

Program initiation/switchingResource allocation

Technology Topic

Real-time computingResource use +4

Image

  • Task scheduling method and device
  • Task scheduling method and device
  • Task scheduling method and device

Examples

  • Experimental program(6)

Example Embodiment

[0057] Example one
[0058] This embodiment provides a job scheduling method, such as figure 1 As shown, including the following steps:
[0059] Step 101: For the first job in the waiting queue in the online mode, according to the task information of all jobs before the first job, estimate the first time point when the available resources meet the requirements of the first job;
[0060] Step 102: Compare the first time point with the upper limit of the waiting time of the first job;
[0061] Step 103: When the first time point is greater than the upper limit of the waiting time of the first job, switch the first job to run in an offline mode.
[0062] In this embodiment, when the scheduled job is in the waiting state, the first time point when the available resources can meet the needs of the scheduled job can be estimated at any time according to the situation of the scheduled job and the current running conditions of other jobs. If the first time is greater than the upper limit of the waiting time of the first job, the first job will be directly transferred to the offline mode to run. In this way, it can be placed in the waiting queue according to the running status of the scheduled job itself and the current running status of other jobs The reasonable scheduling of each job improves the processing efficiency and resource utilization in the distributed system.
[0063] In practical applications, a distributed system will run on a cluster composed of multiple physical nodes. The method of this embodiment is implemented by the master physical node (Master) in the cluster. If the main physical node in the cluster structure is implemented by multiple designated physical nodes (Clients) executing a certain algorithm in parallel, then the method of this embodiment can be executed in parallel through the multiple designated nodes.
[0064] In actual applications, after the job is submitted, if the resources are sufficient, it will be scheduled immediately without waiting. If the current available resources do not satisfy the request of the job, the job will be added to the waiting queue in the online mode. In this embodiment, for the first job in the waiting queue in the online mode, the first time when the available resources meet the requirements of the first job can be estimated based on the task information of the unfinished tasks in all the jobs before the first job point. Wherein, the task information includes at least: the running time of the unfinished task, the number of instances, and the running status of each instance.
[0065] In a distributed system, a job contains multiple tasks, and each task contains multiple instances. The instance is the smallest unit of the job, and each instance corresponds to an actual physical process. There is a certain correspondence between instances and resources. Therefore, as many resources as there are instances in a job. The running status of each job in the distributed system can be queried through the running log. The running log contains task information of each task in the job. Each piece of task information corresponds to a task, which can include task identification (such as task ID), job Identification (such as job ID), task running status (such as information identifying task running, information identifying task running end, etc.), task running time (such as running start time, running end time, etc.), number of instances, and each The running status of each instance (for example, information identifying the running of the instance, information identifying the end of the running of the instance, etc.).
[0066] In some implementation manners, the first time point may be estimated in the following manner: according to task information of unfinished tasks in all jobs before the first job in online mode, the task end time of the unfinished task is estimated And the corresponding amount of releasable resources; according to the end time of the task and the corresponding amount of releasable resources, and the current amount of available resources, determine the first moment when the available resources meet the requirements of the first job. In this way, by establishing the mapping relationship between the task end time of each task and the number of releasable resources, the number of available resources at the end of each task can be obtained in real time, and the first time point at which the available resources can meet the requirements of the first task can be determined in real time. .
[0067] Specifically, the task end time of the unfinished task can be obtained according to the running time and the current time point of the unfinished task; the unfinished task can be obtained according to the number of instances of the unfinished task and the running status of each instance The number of unfinished running instances in the unfinished task is determined, and the number of releasable resources of the unfinished task is determined based on the number of unfinished running instances in the unfinished task. In this embodiment, the number of resources that can be released after the task is completed is estimated by the number of instances in the task, which is more accurate.
[0068] In this embodiment, after estimating the task end time and the number of releasable resources of the unfinished tasks in each job, the task end time and the number of releasable resources of the unfinished tasks in each job can be correspondingly saved so that it can be passed Querying the stored information to estimate the first moment is beneficial to improve processing efficiency.
[0069] In this embodiment, the task end time and the number of releasable resources of the unfinished task can be stored in multiple ways. For example, a predefined data structure can be used to save the task ending time and the amount of released resources of the unfinished task. The data structure may include at least the following parts: the first part that records the end time of the task; the second part that records the number of releasable resources; the third part that records the task identification (such as the task ID and the job ID), and so on. For another example, the task ending time and the amount of released resources of the unfinished task can be recorded in the form of a histogram. Of course, other forms besides the above-mentioned forms may also be used in practical applications to store information such as the end time of the task and the corresponding amount of releasable resources.
[0070] In some real-time methods, after the task end time and the number of releasable resources are saved, they can also be updated in real time according to the running status of each task. When a task is finished running, delete the task end time and the number of free resources corresponding to the task. On the one hand, it can ensure that the saved data is most in line with the current operation of the job, which is beneficial to improve the accuracy of the first moment of estimation ; On the other hand, delete unnecessary data in time to save storage space.
[0071] In this embodiment, the upper limit of the waiting time of the first job is determined according to the upper limit of the waiting time of the first job. For example, the upper limit of the waiting time of the first job can be obtained by the sum of the submission time of the first job and the upper limit of the waiting time.
[0072] Among them, the upper limit of the waiting time of the first job can be obtained in various ways. For example, the upper limit of the waiting time may be set by the user, and set in the submission request of the first job shown before the first job is submitted. For another example, the online mode running time and the offline mode running time of the first job can be determined according to the historical running data of the first job, and then the waiting time of the job can be determined according to the online mode running time and the offline mode running time of the first job Maximum duration.
[0073] In some implementations, the historical operation data may include offline mode operation data and online mode operation data, and the waiting time of the first job may be determined based on the offline mode operation data and online mode operation data of the first job Upper limit.
[0074] Wherein, the offline mode operation data of the first job may include: offline mode operation time information of each task in the first job; the online mode operation data of the first job may include: each task in the first job Information about the running time of the task in online mode.
[0075] Specifically, the offline mode running time and the online mode running time of the first job can be determined according to the offline mode running time information and online mode running time information of each task in the first job; The submission time, the offline mode operating time and the online mode operating time determine the upper limit of the waiting time of the first job.
[0076] For example, the sum of the difference between the submission time and the running time in offline mode minus the running time in online mode can be used as the upper limit of the waiting time of the first job. In this way, it is determined that the actual waiting time of the first job is greater than the running time in offline mode. When the difference between the running time in online mode is the first job is transferred to offline mode.
[0077] For another example, a waiting time threshold may be preset, and the maximum value between the waiting time threshold and the difference between the offline mode operating time minus the online mode operating time may be determined, and the sum of the maximum value and the submission time of the first job is taken as the value. The upper limit of the waiting time of the first job is described. Of course, other methods can also be used to determine the upper limit of the waiting time of the first job in practical applications, and this article does not limit this.
[0078] In practical applications, the distributed system runs the same job logic, only the amount of input data is different. When the job is executed according to the input data, the online mode operation data and the offline mode operation data of the job are recorded in the database. In this embodiment, the running time length of a job in the offline mode and the running time length in the online mode can be obtained according to the running data recorded in the database.
[0079] In some implementation manners, the online mode running time and the offline mode running time of the job are estimated based on the historical running data of the job and the current input data volume. That is to say, the running time in the online mode and the running time in the offline mode can be estimated according to the historical running data and the amount of input data of the job. For example, the running time of each task in the job can be estimated based on historical running data, and then the running time of the job can be obtained from the sum of the running time of each task.
[0080] In practical applications, the historical running data of the job may include: the amount of input data of the job, the number of tasks, the number of instances in each task, and the running time of each task. For example, the running time of a single instance of the job can be estimated based on the running time of each task in the job. Since the amount of input data of a job is proportional to the number of instances, the total number of instances of the job in this round can be estimated based on the amount of input data of the job in this round, which can be estimated by the product of the total number of instances and the running time of the single instance The duration of the operation described in this round. Both online mode operation time and offline mode operation time can be estimated by the above method. In addition, other methods can also be used for estimation, and this article is not limited. For a running job, you can get the task information of the running job from the running log, including information about which tasks have ended and which tasks are running. For a running task, you can also get information about how long the task needs to run (that is, the running time), which instances of the task are running, and so on. Based on this information, you can get the task information of the job and estimate its running task information. , The running task information may at least include the task ending time of the running task, the number of releasable resources, task ID, job ID, etc. Among them, the task ending time of the running task can be obtained from the current time and the running duration of the task, and the number of releasable resources can be obtained from the number of running instances of the task. In this way, the end time of the job and the amount of released resources can be estimated, and then the time when the resources meet the job requirements in the waiting queue can be estimated.
[0081] In some implementation manners, the value of the waiting time preset by the user may be parsed from the submission request of the first job; and the upper limit of the waiting time of the first job is determined according to the value of the waiting time. For example, the sum of the submission time and the waiting time may be used as the upper limit of the waiting time of the first job; for another example, the waiting time threshold may be preset to determine the waiting time threshold and the waiting time preset by the user The maximum value between the duration values, and the sum of the maximum value and the submission time of the first job as the upper limit of the waiting time of the first job. Of course, other methods can also be used to determine the upper limit of the waiting time of the first job in practical applications, and this article does not limit this.
[0082] In this embodiment, in order to ensure that the first job can at least be added to the waiting queue when submitted to the online mode, the waiting time threshold of the first job can also be preconfigured; the waiting time threshold of the first job can be determined according to the waiting time threshold. The lower limit of the waiting time; when the current available resources do not meet the requirements of the first job and the current time point is not greater than the lower limit of the waiting time of the first job, the first job is added to the waiting queue or kept The waiting state of the first job in the waiting queue.
[0083] In this embodiment, when the first time point is not greater than the upper limit of the waiting time of the first job, the waiting state of the first job in the waiting queue is maintained.
[0084] In some implementations, the first time point may be re-evaluated regularly; the first time point and the upper limit of the waiting time of the first job may be re-compared regularly, so as to adjust the waiting state of the job in the waiting queue in real time , Which is conducive to improving the processing efficiency and resource utilization of the distributed system.

Example

[0085] Example one
[0086] The following describes in detail the process of estimating the end time of the task and the corresponding amount of releasable resources and the storage method of the histogram in the form of an example.
[0087] Before performing scheduling processing on the jobs in the waiting queue, the task ending time of the unfinished tasks in the previous job and the number of releasable resources at the end can be estimated in advance, and converted into a histogram for easy storage.
[0088] Such as figure 2 An example of a histogram is shown. Each bar in the histogram corresponds to an unfinished task. The width of the bar indicates the number of resources that can be released for the unfinished task. The time point corresponding to the bar is the end of the unfinished task. time.
[0089] Such as image 3 As shown, the end time of the task and the corresponding amount of free resources can be estimated through the following process and converted into histogram elements:
[0090] Step 301: Obtain a job list containing all jobs before the job to be scheduled;
[0091] Step 302, traverse one job in the job list;
[0092] Step 303: Obtain the running time information of each task in the online mode of the job from the historical running data of the job;
[0093] Step 304, traverse an unfinished task in the job;
[0094] Step 305: Calculate the task end time of the task according to the difference between the total running time minus the running time in the running time information of the task and the current time, and determine the task based on the number of unfinished instances in the task And fill in the histogram;
[0095] If a column element corresponding to the end time of the task already exists in the histogram, then the number of releasable resources of the task and the number of releasable resources of the existing task on the column element are combined;
[0096] If there is no column element corresponding to the end time of the task in the histogram, a new column element is created, and the number of releasable resources of the task is recorded by the column element.
[0097] Step 306: Determine whether all unfinished tasks of the job have been traversed, if yes, proceed to step 307, otherwise proceed to step 304;
[0098] Step 307: Determine whether all the jobs in the job list have been traversed, if yes, end the current process, otherwise return to step 302 to traverse the next job.

Example

[0099] Example two
[0100] The following uses specific examples to describe in detail the manner of determining the lower limit of the waiting time and the upper limit of the waiting time of the job in this embodiment.
[0101] In practical applications, the lower limit of the waiting time and the upper limit of the waiting time can be determined by the following formula:
[0102] Lower limit of waiting time = job submission time + waiting time threshold;
[0103] Upper limit of waiting time = job submission time + max (waiting time threshold, Tx2-Tx1);
[0104] Wherein, Tx2 represents the running time of the job in offline mode, Tx1 represents the running time of the job in online mode, and the waiting time threshold can be an empirical value, which can be calculated through historical running data of each job in online mode The analysis shows that, for example, the waiting time threshold can be set to 10 seconds.
[0105] In practical applications, when a job is submitted to online mode, if the current resources are sufficient, it will be scheduled immediately without waiting. If the current resource does not satisfy the AON request of the job, the job will be added to the waiting queue in the online mode. In this embodiment, a lower limit of waiting time is set for each job to ensure that the job in online mode can at least be added to the waiting queue in online mode. After waiting for a certain period of time, determine whether to switch to offline mode. Compatible with the original processing flow of the online mode, making the method of this embodiment more compatible. On the other hand, if the job cannot be scheduled in time after the job is submitted to the online mode, it will wait at least a certain period of time, which can also greatly improve the performance of the distributed system. The processing speed and throughput rate help to improve the overall utilization of the physical cluster.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Network element performance data alarm method and device

PendingCN110879774Aimprove rationality
Owner:BEIJING TIANYUAN INNOVATION TECH CO LTD

Convenient pickled vegetable canning device

Owner:赣州巧耕人家农业发展有限公司

Admission control method and device, storage medium and terminal

ActiveCN109788525AImprove rationality
Owner:SPREADTRUM COMM (SHANGHAI) CO LTD

Classification and recommendation of technical efficacy words

  • improve rationality

Method and apparatus for assessing standard fulfillment of character writing

ActiveCN102609735ASolve the low normative scoreimprove rationality
Owner:IFLYTEK CO LTD

Electric power system recovery method based on node importance degree

ActiveCN103746366ANode importance is objectiveimprove rationality
Owner:STATE GRID ZHEJIANG ELECTRIC POWER +2

Flexible variable-arm long rotary sprinkling machine

InactiveCN101822197AIncrease or decrease the number of sectionsimprove rationality
Owner:XI AN JIAOTONG UNIV +1

HEVC basic unit level code rate allocation method

ActiveCN104333761Aimprove rationalitysmall encoding distortion
Owner:FUCHUN COMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products