This disclosure relates to the field of internet technologies, and in particular, to a scheduler, a job scheduling method, and a related device.
A computing network usually includes a plurality of cross-area data centers that are interconnected through a wide area network, and a computing resource, a storage resource, and a network resource in the computing network can be flexibly scheduled based on a requirement. A cluster scheduler, for example, one or more of a Slurm in a high-performance computing (HPC) scenario, a load sharing facility (LSF), a portable batch system (PBS), Kubernetes, and a Yet Another Resource Scheduler (YARN), is configured inside each data center. In addition, a cross-data center scheduler is further deployed in the computing network. The scheduler dynamically connects to the cluster scheduler in each data center, to implement cross-data center resource scheduling.
Currently, the scheduler schedules a job of a user and data required for processing the job to a cluster in a data center for processing. In this process, if waiting duration of a process from submission to execution of the job of the user is excessively long, user experience may be affected because the job of the user is left unprocessed for long duration. Therefore, how to improve job processing efficiency and improve user experience becomes an important problem that needs to be urgently resolved.
This disclosure provides a scheduler configured to reduce waiting duration from submission to execution of a job, so that job processing efficiency is improved, thereby improving user experience. In addition, this disclosure further provides a job scheduling method, a computer-readable storage medium, and a computer program product.
According to a first aspect, a scheduler is configured to manage a plurality of clusters and includes a management module and a proxy module. The management module is configured to obtain a to-be-processed job, for example, a job submitted by a user by using a terminal or a client; determine, from the plurality of clusters, a target cluster for processing the job; and deliver the job to the proxy module. The proxy module is configured to indicate the target cluster to schedule a resource for the job, and obtain target data in a process of scheduling the resource for the job. The target data is data that may be required for executing the job.
In this way, the target cluster can concurrently perform, under scheduling of the scheduler, a process of transmitting the target data and the process of scheduling the resource, to effectively reduce waiting duration of a process from submission to execution of the job, so that job processing efficiency is improved, thereby improving user experience. In addition, the resource allocated by the target cluster to the job can be prevented from being in an idle state for long duration, so that a problem of a resource waste can be alleviated.
In a possible implementation, when determining, from the plurality of clusters, the target cluster for processing the job, the management module specifically estimates first duration in which each of the plurality of clusters schedules a resource for the job; calculates second duration in which each of the plurality of clusters obtains the target data; and then uses a larger value in the first duration and the second duration as waiting duration for the cluster to process the job, to use a cluster with smallest waiting duration in the plurality of clusters as the target cluster. In this way, the management module schedules the job to the target cluster with the smallest waiting duration. This helps reduce time consumed to process the job, in other words, the job processing efficiency can be further improved.
Optionally, the management module may alternatively schedule, based on load of each cluster, the job to a cluster with smallest load for processing, to implement load balancing in a computing network.
In a possible implementation, the management module is further configured to estimate first duration in which the target cluster schedules the resource for the job; calculate second duration in which the target cluster obtains the target data; and send the first duration and the second duration to the proxy module. In this case, when indicating the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job, the proxy module may specifically indicate, when the first duration is greater than the second duration (in other words, time consumed for resource scheduling is greater than time consumed for data obtaining), the target cluster to obtain the target data in the process of scheduling the resource for the job. In this way, the target cluster can concurrently perform the process of scheduling the resource and the process of obtaining the target data, so that after completing resource scheduling, the target cluster can execute the job by using the scheduled resource, to improve processing efficiency of the service.
Optionally, after the management module delivers the job to the proxy module, the proxy module may alternatively estimate the first duration in which the target cluster schedules the resource for the job, and calculate the second duration in which the target cluster obtains the target data, to indicate, based on the first duration and the second duration, the target cluster to obtain the target data in the process of scheduling the resource for the job.
In a possible implementation, the management module is alternatively configured to estimate first duration in which the target cluster schedules the resource for the job; calculate second duration in which the target cluster obtains the target data; and send the first duration and the second duration to the proxy module. In this case, when indicating the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job, the proxy module may specifically indicate, when the first duration is not greater than the second duration and at a first moment before indicating the target cluster to schedule the resource for the job, the target cluster to start to obtain the target data, and indicate, at a second moment, the target cluster to schedule the resource for the job. Duration of an interval between the first moment and the second moment is the second duration minus the first duration. In this way, the target cluster can first perform the process of obtaining the data, and then perform, in the process of obtaining the data, the process of scheduling the resource. Therefore, the target cluster ends, at a same moment or close moments, the process of scheduling the resource and the process of obtaining the data, to execute the job by using the scheduled resource. In this way, not only the job processing efficiency can be improved, but also a problem that the resource scheduled by the target cluster for the job is wasted due to waiting for the target cluster to obtain the target data can be avoided.
In a possible implementation, when estimating the first duration in which the target cluster schedules the resource for the job, the management module may specifically determine a target category to which the job belongs; calculate average duration in which the target cluster schedules a resource for a historical job of the target category; and obtain a currently available resource ratio and a historically available resource ratio that are of the target cluster. The currently available resource ratio is a ratio of a resource quantity of currently available resources of the target cluster to a resource quantity of total resources. The historically available resource ratio is a ratio of a resource quantity of available resources of the target cluster in a past time period to the resource quantity of total resources. In this way, the management module obtains, through estimation based on the average duration, the currently available resource ratio, and the historically available resource ratio, the first duration in which the target cluster schedules the resource for the job. In this way, the management module can obtain, through estimation by using time consumed by each cluster to schedule a resource for a job of a same category in the past time period, time consumed by the cluster to schedule a resource for a job submitted by a current user, to improve accuracy and reliability of estimation.
In a process of calculating the currently available resource ratio, when the available resource includes one resource, for example, includes a computing resource, the currently available resource ratio may be specifically a ratio of a quantity of available processors (or processor cores) in the target cluster to a total quantity of processors (or a total quantity of processor cores). When the available resource includes a plurality of types of resources, for example, includes a computing resource, a storage resource, and a network resource, the currently available resource ratio may be obtained by performing weighted summation based on a ratio of a resource quantity of available resources of each type to a resource quantity of total resources of the type, or may be obtained through calculation in another manner.
In a process of calculating the historically available resource ratio, the management module may count resource quantities of available resources when the target cluster respectively allocates resources to the historical job at a plurality of moments in the past time period. Then, the management module may calculate an average value of the resource quantities of available resources respectively corresponding to the plurality of moments, to further calculate a ratio of the average value of the resource quantities of available resources to the resource quantity of total resources of the target cluster. Alternatively, the management module may use a ratio of a resource quantity of available resources when the target cluster allocates a resource to the historical job at a past moment to the resource quantity of total resources of the target cluster as the historically available resource ratio.
In a possible implementation, the target category to which the job submitted by the user belongs is determined based on one or more of a category of a requested resource, a quantity of requested resources, a volume of data on which the job depends, an application to which the job belongs, a job priority, a queue in which the job is located, and a calculation instance to which the job belongs. Further, the target category may alternatively be determined based on a job owner. The job owner is a subject to which the job belongs, and may be a tenant, a user, or the like.
In a possible implementation, the proxy module is further configured to monitor third duration in which the target cluster schedules the resource for the job, and indicate, based on the third duration and the estimated first duration, the management module to send an adjustment instruction to a network controller of the target cluster. The adjustment instruction instructs the network controller to adjust a network bandwidth of the target cluster or adjust a quantity of network channels of the target cluster. In this way, when the duration in which the target cluster actually schedules the resource for the job is less than the estimated duration, the network bandwidth of the target cluster or the quantity of network channels is adjusted, so that the target cluster can end, at a same moment or close moments, the process of scheduling the resource and the process of obtaining the target data.
In a possible implementation, when the third duration is less than the first duration, and a difference between the first duration and the third duration is greater than a preset value, it indicates that time consumed by the target cluster to actually schedule the resource for the job is less than estimated time consumption. In this case, the adjustment instruction sent by the management module to the network controller instructs the network controller to increase the network bandwidth of the target cluster or increase the quantity of network channels of the target cluster. In this way, a rate at which the target cluster obtains the target data can be increased, so that time consumed by the target cluster to obtain the target data is reduced. Therefore, not only the job processing efficiency can be further improved, but also the problem that the resource scheduled by the target cluster for the job is wasted due to long-duration waiting for the target cluster to obtain the target data can be avoided.
In a possible implementation, when the third duration is greater than the first duration, and a difference between the third duration and the first duration is greater than a preset value, it indicates that time consumed by the target cluster to actually schedule the resource for the job is greater than estimated time consumption. In this case, the adjustment instruction sent by the management module to the network controller instructs the network controller to decrease the network bandwidth of the target cluster or decrease the quantity of network channels of the target cluster. In this way, after scheduling the resource for the job, the target cluster can further complete, at a close moment, the receiving of the target data, so that bandwidth resource consumption in the computing network can be reduced by decreasing the network bandwidth of the target cluster under a condition that the resource allocated by the target cluster to the job is not idle.
In a possible implementation, the management module and the proxy module may be deployed on one computing device, and the computing device is connected to the plurality of clusters, to manage the plurality of clusters.
In a possible implementation, the management module is deployed on a computing device, and the proxy module is deployed in the target cluster, so that the management module can control, by using the proxy module in the target cluster, the target cluster to concurrently perform the process of obtaining the data and the process of scheduling the resource.
According to a second aspect, a job scheduling method is applied to a scheduler, and the scheduler includes a management module and a proxy module. Specifically, the management module obtains a to-be-processed job; determines, from a plurality of clusters, a target cluster for processing the job; and delivers the job to the proxy module. The proxy module indicates the target cluster to schedule a resource for the job, and obtain target data in a process of scheduling the resource for the job. The target data is data that may be required for executing the job.
In a possible implementation, that the management module determines, from a plurality of clusters, a target cluster for processing the job includes: The management module estimates first duration in which each of the plurality of clusters schedules a resource for the job, and calculates second duration in which each of the plurality of clusters obtains the target data. Then the management module uses a larger value in the first duration and the second duration as waiting duration for the cluster to process the job, and uses a cluster with smallest waiting duration in the plurality of clusters as the target cluster.
Optionally, the management module may alternatively schedule, based on load of each cluster, the job to a cluster with smallest load for processing, to implement load balancing in a computing network.
In a possible implementation, before the proxy module indicates the target cluster to obtain the target data in the process of scheduling the resource for the job, the management module further estimates first duration in which the target cluster schedules the resource for the job; calculates second duration in which the target cluster obtains the target data; and sends the first duration and the second duration to the proxy module. In this way, when indicating the target cluster to obtain the target data in the process of scheduling the resource for the job, the proxy module may specifically indicate, when the first duration is greater than the second duration, the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job.
Optionally, after the management module delivers the job to the proxy module, the proxy module may alternatively estimate the first duration in which the target cluster schedules the resource for the job, and calculate the second duration in which the target cluster obtains the target data, to indicate, based on the first duration and the second duration, the target cluster to obtain the target data in the process of scheduling the resource for the job.
In a possible implementation, before the proxy module indicates the target cluster to obtain the target data in the process of scheduling the resource for the job, the management module further estimates first duration in which the target cluster schedules the resource for the job; calculates second duration in which the target cluster obtains the target data; and sends the first duration and the second duration to the proxy module. In this way, when indicating the target cluster to obtain the target data in the process of scheduling the resource for the job, the proxy module may specifically indicate, when the first duration is not greater than the second duration and at a first moment before indicating the target cluster to schedule the resource for the job, the target cluster to start to obtain the target data, and indicate, at a second moment, the target cluster to schedule the resource for the job. Duration of an interval between the first moment and the second moment is the second duration minus the first duration.
In a possible implementation, when estimating the first duration in which the target cluster schedules the resource for the job, the management module may specifically determine a target category to which the job belongs; calculate average duration in which the target cluster schedules a resource for a historical job of the target category; and obtain a currently available resource ratio and a historically available resource ratio that are of the target cluster. The currently available resource ratio is a ratio of a resource quantity of currently available resources of the target cluster to a resource quantity of total resources. The historically available resource ratio is a ratio of a resource quantity of available resources of the target cluster in a past time period to the resource quantity of total resources. In this way, the management module estimates, based on the average duration, the currently available resource ratio, and the historically available resource ratio, the first duration in which the target cluster schedules the resource for the job.
In a process of calculating the currently available resource ratio, when the available resource includes one resource, for example, includes a computing resource, the currently available resource ratio may be specifically a ratio of a quantity of available processors (or processor cores) in the target cluster to a total quantity of processors (or a total quantity of processor cores). When the available resource includes a plurality of types of resources, for example, includes a computing resource, a storage resource, and a network resource, the currently available resource ratio may be obtained by performing weighted summation based on a ratio of a resource quantity of available resources of each type to a resource quantity of total resources of the type, or may be obtained through calculation in another manner.
In a process of calculating the historically available resource ratio, the management module may count resource quantities of available resources when the target cluster respectively allocates resources to the historical job at a plurality of moments in the past time period. Then, the management module may calculate an average value of the resource quantities of available resources respectively corresponding to the plurality of moments, to further calculate a ratio of the average value of the resource quantities of available resources to the resource quantity of total resources of the target cluster. Alternatively, the management module may use a ratio of a resource quantity of available resources when the target cluster allocates a resource to the historical job at a past moment to the resource quantity of total resources of the target cluster as the historically available resource ratio.
In a possible implementation, the target category is determined based on one or more of a category of a requested resource, a quantity of requested resources, a volume of data on which the job depends, an application to which the job belongs, a job priority, a queue in which the job is located, and a calculation instance to which the job belongs. Optionally, the target category may alternatively be determined based on a job owner.
In a possible implementation, the proxy module may further monitor third duration in which the target cluster schedules the resource for the job, and indicate, based on the first duration and the third duration, the management module to send an adjustment instruction to a network controller of the target cluster. The adjustment instruction instructs the network controller to adjust a network bandwidth of the target cluster or adjust a quantity of network channels of the target cluster.
In a possible implementation, when the third duration is less than the first duration, and a difference between the first duration and the third duration is greater than a preset value, the adjustment instruction instructs the network controller to increase the network bandwidth of the target cluster or increase the quantity of network channels of the target cluster.
In a possible implementation, when the third duration is greater than the first duration, and a difference between the third duration and the first duration is greater than a preset value, the adjustment instruction instructs the network controller to decrease the network bandwidth of the target cluster or decrease the quantity of network channels of the target cluster.
In a possible implementation, the management module and the proxy module are deployed on one computing device, and the computing device is connected to the plurality of clusters.
In a possible implementation, the management module is deployed on a computing device, and the proxy module is deployed in the target cluster.
The job scheduling method provided in the second aspect corresponds to the scheduler provided in the first aspect. Therefore, for technical effects of the job scheduling method in any one of the second aspect and the possible implementations of the second aspect, refer to the technical effects of the first aspect and the corresponding implementations of the first aspect. Details are not described herein again.
According to a third aspect, a scheduler includes a processor and a memory. The memory is configured to store instructions. When the scheduler runs, the processor executes the instructions stored in the memory, to enable the scheduler to perform the steps performed by the management module and the proxy module in any one of the second aspect or the possible implementations of the second aspect. It should be noted that the memory may be integrated into the processor, or may be independent of the processor. The scheduler may further include a bus. The processor is connected to the memory through the bus. The memory may include a readable memory and a random access memory.
According to a fourth aspect, a scheduler includes a processor and a memory. The memory is configured to store instructions. When the scheduler runs, the processor executes the instructions stored in the memory, to enable the scheduler to perform the steps performed by the management module in any one of the second aspect or the possible implementations of the second aspect. It should be noted that the memory may be integrated into the processor, or may be independent of the processor. The scheduler may further include a bus. The processor is connected to the memory through the bus. The memory may include a readable memory and a random access memory.
According to a fifth aspect, a scheduler includes a processor and a memory. The memory is configured to store instructions. When the scheduler runs, the processor executes the instructions stored in the memory, to enable the scheduler to perform the steps performed by the proxy module in any one of the second aspect or the possible implementations of the second aspect. It should be noted that the memory may be integrated into the processor, or may be independent of the processor. The scheduler may further include a bus. The processor is connected to the memory through the bus. The memory may include a readable memory and a random access memory.
According to a sixth aspect, a computer-readable storage medium stores instructions. When the instructions are run on a scheduler, the scheduler is enabled to perform the method in any one of the second aspect or the implementations of the second aspect.
According to a seventh aspect, a computer program product includes instructions. When the computer program product runs on a scheduler, the scheduler is enabled to perform the method in any one of the second aspect or the implementations of the second aspect.
Based on the implementations in the foregoing aspects, the implementations may be further combined to provide more implementations.
To describe the technical solutions in embodiments more clearly, the following briefly describes the accompanying drawings for describing embodiments. It is clear that the accompanying drawings in the following description show merely some embodiments, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings.
In the specification, claims, and accompanying drawings, the terms “first”, “second”, and the like are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the terms used in this manner are interchangeable in proper circumstances, and this is merely a distinguishing manner used when objects with a same attribute are described in embodiments.
Currently, there may be a plurality of types of organizational relationships between different data centers in a computing network. For example, the organizational relationships include a strong management and control relationship between an upper level and a lower level, a peer relationship between non-upper and lower levels, or a combination of the strong management and control relationship and the peer relationship. For example, in a computing network 100 shown in
In each computing network, a cross-cluster scheduler and a cluster scheduler that is deployed in each cluster are usually used to implement cross-cluster resource scheduling (and data scheduling). For example, resource scheduling is performed in the computing network 100 shown in
When the scheduler receives a job (for example, a job of training an artificial intelligence (AI) model) of a user 201, the management module 101 of the scheduler may schedule the job to the cluster B whose available resources meet a resource required for processing the job (or may schedule the job to the cluster A and the cluster C). Specifically, the job may be first scheduled to the proxy module 102 in the cluster B, and then the proxy module 102 indicates the cluster B to schedule a corresponding resource (for example, including a computing resource, a storage resource, and a network resource) for the job. The cluster B may use an internally configured cluster scheduler to schedule the resource for the job. In addition, data (which is referred to as target data below) required for executing the job may be stored in the cluster C. Therefore, the scheduler may further indicate the cluster C to transmit the target data to the cluster B. Alternatively, the target data may be uploaded by the user 201 to the scheduler, so that the scheduler may deliver the target data to the cluster B. Alternatively, the scheduler may send a storage address, for example, a uniform resource locator (URL), of the target data to the cluster B, so that the cluster B may access the cluster C based on the received storage address, to obtain the target data from the cluster C.
In this process, if the cluster B first queues up to schedule the resource for the job and then obtains the target data from the cluster C or the scheduler, time consumed from submission to execution of the job is a sum of waiting duration in which the job queues up in the cluster B for resource allocation and duration in which the target data is transmitted from the cluster C to the cluster B. As a result, waiting duration of a process from submission to execution of the job of the user 201 is long, and consequently, user experience is affected because the job of the user 201 is left unprocessed for long duration.
Based on this, in the scheduler provided in this embodiment, after the management module 101 determines the cluster B for processing the job and delivers the job to the proxy module 102 in the cluster B, the proxy module 102 indicates the target cluster to schedule the resource for the job, and obtain, in a process of scheduling the resource for the job, the target data required for executing the job. In this way, the cluster B concurrently performs a process of obtaining the target data and the process of scheduling the resource for the job, to effectively reduce the waiting duration of the process from submission to execution of the job, so that job processing efficiency is improved, thereby improving user experience. In addition, the resource allocated by the cluster B to the job can be prevented from being in an idle state for long duration, so that a problem of a resource waste can be alleviated.
It should be noted that the foregoing implementation example is described by using an example in which the management module 101 and the proxy modules 102 are deployed in the computing network shown in
In addition, the foregoing computing networks shown in
For ease of understanding, with reference to the accompanying drawings, the following describes in detail a process in which the scheduler performs scheduling for a job of a user.
S401: A management module 101 in a scheduler obtains a to-be-processed job.
During actual application, a user may submit the job to a computing network and request the computing network to process the job. For example, the user may remotely log in to the scheduler by using a terminal or a client that is provided by the management module 101 externally, and submit the job on the terminal or the client. The terminal or the client may generate a data processing request, where the data processing request includes the to-be-processed job submitted by the user, so that the terminal or the client may send the data processing request to the management module 101. Correspondingly, the management module 101 may parse the received data processing request to obtain the job submitted by the user. For example, the job submitted by the user may be, for example, an HPC job or an AI model training job. Correspondingly, the computing network receives the job by using the scheduler, and schedules, by using the scheduler, the job to a corresponding cluster in the computing network for processing.
Further, when submitting the job, the user may further specify a resource required for processing the job, including a resource type, a resource specification, and the like. The resource specified by the user may include one or more of a computing resource, a storage resource, and a network resource. The computing resource may be a resource having a computing capability, such as a central processing unit (CPU), a data processing unit (DPU), or an infrastructure processing unit (IPU). The storage resource may be a resource having a storage capability, such as a cache, a memory, or a storage device. The network resource may be, for example, a network transmission resource such as an uplink bandwidth, a downlink bandwidth, or a network interface card type. Alternatively, the scheduler may automatically determine, based on information such as a job type and a volume of data on which the job depends, the resource required for processing the job. This is not limited in this embodiment.
S402: The management module 101 determines, from a plurality of clusters, a target cluster for processing the job.
In this embodiment, for example, as shown in
In a first possible implementation, the management module 101 may determine the target cluster based on a load balancing policy. Specifically, the management module 101 may obtain current load of each cluster, or predict load of the cluster in a future time period (for example, future two seconds), and determine a cluster with smallest load as the target cluster for processing the job submitted by the user.
In a second possible implementation, the management module 101 estimates waiting duration for each of the plurality of clusters to process the job. The waiting duration corresponding to each cluster is determined based on estimated first duration in which the cluster allocates the resource to the job submitted by the user and second duration in which the cluster receives target data on which the job depends. In this way, the management module 101 may determine a cluster with smallest waiting duration in the plurality of clusters as the target cluster that actually processes the job.
Specifically, each cluster may receive a plurality of jobs. As a result, the plurality of jobs usually queue up to wait for the cluster to allocate, to the plurality of jobs, resources required for processing the jobs. Therefore, the first duration in which the cluster schedules the resource for the job submitted by the user is a sum of queuing duration of the job and duration in which the cluster allocates the resource to the job. In this case, as shown in
In addition, the target data (for example, a training sample on which the AI model training job depends) on which execution of the job depends may be stored only in a part of the clusters in the computing network. As a result, when the cluster for processing the job does not store the target data, the target data usually needs to be obtained from another cluster. The another cluster may be, for example, a cluster that is closest to the cluster and that stores the target data. Alternatively, when submitting the job, the user further uploads, to the management module 101, the target data required for executing the job, so that the management module 101 may send, to the cluster, the target data uploaded by the user. Alternatively, the management module 101 may send, to the cluster, a storage address of the target data in the computing network, so that the cluster may obtain the target data from the computing network based on the storage address. In this case, as shown in
Then, the management module 101 may perform step S4023 and step S4024, to determine the target cluster. Specifically, for each cluster, the management module 101 may compare the first duration and the second duration that correspond to the cluster, and determine a larger value in the first duration and the second duration as duration in which the job needs to wait for being processed when being delivered to the cluster, namely, the foregoing waiting duration. In this way, the management module 101 may determine, from the plurality of clusters based on the waiting duration corresponding to each cluster, the target cluster with the smallest job waiting duration. For example, the management module 101 may sort the waiting duration corresponding to each cluster in ascending order, and determine waiting duration with a smallest value, so that a cluster corresponding to the waiting duration with the smallest value may be determined as the target cluster.
During actual application, because remaining available resources in a part of the clusters in the computing network may not meet a resource condition required for executing the job. For example, a resource type or a resource quantity of the remaining available resources does not meet the resource condition. Therefore, in a process of determining the target cluster, the management module 101 may first filter out a cluster that is in the computing network and whose remaining available resource does not meet the resource condition, and further determine the target cluster from a plurality of clusters obtained through filtration. In this way, a quantity of calculation required by the management module 101 to determine the target cluster can be reduced.
For example, in the process of determining the target cluster based on the second implementation, when estimating the first duration in which each cluster allocates the resource to the job submitted by the user, the management module 101 may determine the target cluster based on duration in which the cluster allocates the resource to the historical job in the past time period (for example, a past month).
During specific implementation, the management module 101 may classify jobs in the computing network into a plurality of categories in advance. For example, the management module 101 may classify the jobs based on one or more of the following information corresponding to the jobs: a category of a requested resource, a quantity of requested resources, a volume of data on which the job depends, an application to which the job belongs, a job priority, a job owner (for example, a user or a tenant to which the job belongs), a queue in which the job is located, and a calculation instance to which the job belongs. During actual application, categories to which the jobs in the computing network belong may be preconfigured in the management module 101 by a skilled person. In this way, for each of the plurality of clusters, the management module 101 may calculate average duration in which the cluster schedules resources for a plurality of historical jobs of each category in the past time period (where if a quantity of historical jobs of a category is one, the average duration is duration in which the cluster schedules a resource for the historical job). In this way, the management module 101 may calculate the average duration in which each cluster schedules the resource for the historical job of each category.
In addition, for each of the plurality of clusters, the management module 101 further obtains a currently available resource ratio and a historically available resource ratio of the historical job of each category in the cluster. The currently available resource ratio is a ratio of a resource quantity of currently available resources of the cluster to a resource quantity of total resources of the cluster. For example, when the available resource includes one resource, for example, includes a computing resource, the currently available resource ratio may be specifically a ratio of a quantity of available processors (or processor cores) in the cluster to a total quantity of processors (or a total quantity of processor cores). When the available resource includes a plurality of types of resources, for example, includes a computing resource, a storage resource, and a network resource, the currently available resource ratio may be obtained by performing weighted summation based on a ratio of a resource quantity of available resources of each type to a resource quantity of total resources of the type, or may be obtained through calculation in another manner. This is not limited in this embodiment.
The historically available resource ratio is a ratio of an average value (which is referred to as an average quantity of available resources below) of resource quantities of available resources to the resource quantity of total resources of the cluster when the cluster allocates resources to the plurality of historical jobs of each category in a time period before the cluster schedules the resource for the job submitted by the user. For example, the management module 101 may count resource quantities of available resources when the cluster allocates resources to the historical job respectively at a plurality of moments in the past time period, and then the management module 101 may calculate the average resource quantity of available resources based on the resource quantities of available resources corresponding to the plurality of moments, to further calculate the ratio of the average resource quantity of available resources to the resource quantity of total resources of the cluster. In another embodiment, the historically available resource ratio may alternatively be a ratio of a resource quantity of available resources to the resource quantity of total resources of the cluster when the cluster allocates resources to the plurality of historical jobs of each category at a moment before the cluster schedules the resource for the job submitted by the user. This is not limited in this embodiment.
During actual application, the management module 101 may calculate, based on resource usage of each cluster, a currently available resource ratio and a historically available resource ratio that correspond to each category of historical job in each cluster.
In this way, after receiving the job submitted by the user, for each cluster, the management module 101 may determine, based on a target category to which the job belongs, average duration in which the cluster schedules a resource for a historical job of the target category, to estimate, based on the average duration corresponding to the historical job of the target category, the currently available resource ratio, and the historically available resource ratio, the first duration in which the cluster queues up, for the job submitted by the user, to wait for resource allocation. In this way, the first duration in which each cluster schedules the resource for the job submitted by the user may be obtained through estimation. In an example, the management module 101 may calculate the first duration by using the following formula (1):
where Tq is the estimated first duration in which the cluster schedules the resource for the job submitted by the user; Tqx is the average duration in which the cluster allocates the resource to the historical job of the target category; RPx is the historically available resource ratio; and RPcurrent is the currently available resource ratio. Based on the foregoing similar process, the management module 101 may determine corresponding first duration in which each cluster schedules a resource for each category of job.
It should be noted that the foregoing implementation of estimating the first duration in which the target cluster schedules the resource for the job is merely used as an example for description. In another embodiment, the management module 101 may alternatively estimate the first duration in another manner. For example, after determining duration in which the target cluster allocates resources to a plurality of historical jobs in a past time period, the scheduler may estimate, based on a median of the duration corresponding to the plurality of historical jobs, the foregoing currently available resource ratio, and the foregoing historically available resource ratio, the first duration in which the target cluster schedules the resource for the job. During actual application, whether the management module 101 selects, based on the duration corresponding to the plurality of historical jobs, the median or the average value to calculate the first duration may be determined based on configuration that is set by a skilled person in advance and that is of the management module 101.
S403: The management module 101 delivers the job to a proxy module 102 corresponding to the target cluster.
For example, after determining the target cluster, the management module 101 may send an execution instruction to the proxy module 102 corresponding to the target cluster, where the execution instruction includes the job submitted by the user, to instruct the proxy module 102 to control the target cluster to execute the job.
During actual application, when the target cluster does not store the target data required for executing the job, the management module 101 may further send the target data to the target cluster. For example, the target data may be uploaded by the user, so that the management module 101 delivers both the job and the target data to the target cluster after determining the target cluster. Alternatively, the target data may be stored in another cluster in the computing network. In this case, the management module 101 may indicate the target cluster to request the target data from the another cluster that stores the target data. Alternatively, the management module 101 may send a data sharing request to the another cluster, to indicate the another cluster to share the target data with the target cluster. In this embodiment, a specific implementation in which the target cluster obtains the target data from the management module 101 or the another cluster is not limited.
S404: The proxy module 102 indicates the target cluster to schedule the resource for the job, and obtain the target data in a process of scheduling the resource for the job, where the target data is the data required for executing the job.
If the target cluster serially performs a process of obtaining the target data and the process of scheduling the resource for the job, a process from submission to execution of the job consumes excessively long time, and consequently, processing efficiency of job execution is affected. Therefore, in this embodiment, the proxy module 102 may indicate the target cluster to obtain the target data in the process of scheduling the resource for the job. In this way, the target cluster may implement accelerated job processing by concurrently performing the process of obtaining the target data and the process of scheduling the resource for the job. When the management module 101 and the proxy module 102 are deployed on a same computing device, after the management module 101 delivers the job to the proxy module 102, the proxy module 102 may send the job to a cluster scheduler of the target cluster, to trigger the cluster scheduler to schedule the resource for the job. When the proxy module 102 is deployed in the target cluster, after the management module 101 delivers the job to the proxy module 102, the proxy module 102 may trigger a cluster scheduler of the target cluster to schedule the resource for the job.
During specific implementation, as shown in
Then, the proxy module 102 may perform step S4042, step S4043, and step S4044.
Specifically, the proxy module 102 compares the first duration Tq and the second duration Tt. In addition, when the first duration Tq is greater than the second duration Tt, the proxy module 102 indicates the target cluster to obtain the target data in the process of scheduling the resource for the job. During specific implementation, the proxy module 102 may submit the job to the cluster scheduler inside the target cluster, to trigger the cluster scheduler to start to allocate a resource in the target cluster to the job. In addition, the proxy module 102 may indicate the target cluster to obtain the target data, for example, to receive the target data sent by the management module 101 or the another cluster. In this way, in the process of scheduling the resource for the job, the target cluster simultaneously performs an operation of obtaining the target data, to implement concurrent processing of resource scheduling and data obtaining, so as to improve job processing efficiency.
When waiting duration Tq is not greater than the second duration Tt, the proxy module 102 may calculate a difference between the first duration Tq and the second duration Tt, and determine, based on the difference, a moment 1 of triggering the target cluster to schedule the resource for the job and a moment 2 of indicating the target cluster to obtain the target data. The moment 2 is earlier than the moment 1, and duration of an interval between the moment 2 and the moment 1 is the difference. Then, the proxy module 102 may indicate, at the moment 2, the target cluster to start to obtain the target data. In addition, in a process in which the target cluster receives the target data, the proxy module 102 indicates, at the moment 1, the target cluster to schedule the resource for the job. In this way, in the process of scheduling the resource for the job, the target cluster simultaneously performs an operation of obtaining the target data, to implement concurrent processing of resource scheduling and data obtaining, so as to improve job processing efficiency. In addition, the target cluster first starts to perform the process of obtaining the target data, and then starts to schedule the resource for the job when a time period passes after the target data is received. In this way, a moment at which the target cluster completes data obtaining and a moment at which the target cluster completes resource scheduling is close, so that a resource waste caused because the target cluster is in a waiting state after scheduling the resource for the job can be avoided.
It should be noted that, in the foregoing implementation, an example in which the management module 101 calculates the first duration Tq and the second duration Tt, and sends the first duration Tq and the second duration Tt to the proxy module 102 is used for description. In another embodiment, the proxy module 102 may perform a process of estimating the first duration Tq in which the target cluster schedules the resource for the job and calculating the second duration Tt in which the target cluster obtains the target data. For example, when the management module 101 determines the target cluster based on current load of each cluster (where the management module 101 does not calculate the first duration and the second duration that correspond to each cluster), after receiving the job delivered by the management module 101, the proxy module 102 may estimate the first duration Tq in which the target cluster schedules the resource for the job and the second duration Tt in which the target cluster obtains the target data. For a specific implementation process, refer to the foregoing related descriptions. Details are not described herein again.
In this embodiment, the proxy module 102 indicates the target cluster to concurrently perform the process of obtaining the target data and the process of scheduling the resource for the job, to effectively reduce waiting duration of a process from submission to execution of the job, so that the job processing efficiency is improved, thereby improving user experience.
In the embodiment shown in
The following describes in detail, with reference to
S501: A management module 101 obtains a to-be-processed target job.
S502: The management module 101 estimates first duration in which each cluster in a computing network schedules a resource for the job submitted by a user.
S503: The management module 101 calculates second duration in which each cluster obtains target data.
S504: The management module 101 uses a larger value in the first duration and the second duration that correspond to each cluster as waiting duration for the cluster to process the job.
S505: The management module 101 uses a cluster with smallest waiting duration in the plurality of clusters as a target cluster.
For a specific implementation process of step S501 to step S505, refer to related descriptions of step S401 and step S402 in the embodiment shown in
S506: The management module 101 delivers the job to a proxy module 102 corresponding to the target cluster.
S507: The proxy module 102 obtains first duration Tq in which the target cluster schedules the resource for the job, and second duration Tt in which the target cluster obtains the target data.
In a first implementation example, because the management module 101 calculates the first duration and the second duration that correspond to each cluster in a process of performing step S502 and step S503, the management module 101 may deliver (for example, delivered with the job) the first duration Tq and the second duration Tt that correspond to the target cluster to the proxy module 102.
In a second implementation example, the proxy module 102 may calculate the first duration Tq in which the target cluster schedules the resource for the job and the second duration Tt in which the target cluster obtains the target data. For a specific implementation process in which the proxy module 102 obtains the first duration Tq and the second duration Tt through calculation, refer to related descriptions that the management module 101 calculates the first duration and the second duration that correspond to each cluster in the foregoing embodiment. Details are not described herein again.
S508: The proxy module 102 compares the first duration Tq and the second duration Tt. In addition, when the first duration Tq is greater than the second duration Tt, step S509 continues to be performed. When the first duration Tq is not greater than the second duration Tt, step S510 continues to be performed.
S509: The proxy module 102 indicates the target cluster to schedule the resource for the job, and obtain the target data in a process of scheduling the resource for the job.
S510: The proxy module 102 indicates, at a moment 2, the target cluster to start to obtain the target data, and the proxy module 102 indicates, at a moment 1, the target cluster to schedule the resource for the job. The moment 2 is earlier than the moment 1, and duration of an interval between the moment 2 and the moment 1 is a difference between the first duration Tq and the second duration Tt.
S511: The proxy module 102 monitors third duration Tq′ in which the target cluster schedules the resource for the job.
S512: Determine whether a difference between the first duration Tq and the third duration Tq′ is less than a preset value, and if the difference is less than the preset value, step S513 continues to be performed. If the difference is greater than or equal to the preset value, no processing is performed.
S513: The proxy module 102 indicates the management module 101 to send an adjustment instruction to a network controller of the target cluster, where the adjustment instruction instructs the network controller to adjust a network bandwidth of the target cluster or adjust a quantity of network channels of the target cluster.
In this embodiment, when there is a large difference between the estimated first duration Tq in which the target cluster schedules the resource for the job and the third duration Tq′ in which the target cluster actually schedules the resource for the job, the scheduler may adjust the network bandwidth used by the target cluster to receive the target data, to synchronously adjust time consumed by the target cluster to receive the target data, so that the target cluster can end resource scheduling and obtaining of the target data at a same moment or close moments.
Specifically, the proxy module 102 may monitor, in real time, the third duration Tq′ in which the target cluster schedules the resource for the job submitted by the user. In addition, when there is a large difference between the third duration Tq′ and the estimated first duration Tq (which may be specifically that the difference between the first duration Tq and the third duration Tq′ is greater than the preset value), it indicates that time consumed by the target cluster to schedule the resource for the job is greatly reduced in comparison with estimated time consumption. In this case, if the target data is received based on the current bandwidth of the target cluster, after the target cluster schedules the resource for the job, the target cluster may start to execute the job only after the target cluster completes receiving of the target data. As a result, a resource waste is caused because the scheduled job is in an idle state for long duration.
Therefore, in this embodiment, the network bandwidth of the target cluster may be increased. During specific implementation, the proxy module 102 may send a bandwidth adjustment request to the management module 101 based on the difference between the first duration Tq and the third duration Tq′. Correspondingly, the management module 101 may send the adjustment instruction to the network controller, to request the network controller to increase the network bandwidth of the target cluster (in other words, increase a network bandwidth of an existing network channel for transmitting data), or add a network channel for the target cluster, where the added network channel is used to increase a speed at which the target cluster receives the target data. In this way, the second duration Tt in which the target cluster receives the target data may be reduced because of an increase in the network bandwidth, so that the target cluster has completed receiving of the target data when completing the resource scheduling, to avoid a problem of a resource waste.
In a possible implementation, in a process of increasing the network bandwidth of the target cluster, the network controller may first increase the network bandwidth of the existing network channel of the target cluster. In addition, if the current network bandwidth of the target cluster meets a requirement before the bandwidth of the existing network channel is adjusted to an upper limit, the network controller may end this bandwidth adjustment, and may not create a new network channel for the target cluster. When the bandwidth of the existing network channel is adjusted to the upper limit, the current network bandwidth of the target cluster still does not reach a network bandwidth requested by the management module 101. In this case, the network controller may create a new network channel for the target cluster, and allocate the new network channel to the target cluster, to increase the network bandwidth of the target cluster, so that the target cluster accelerates, based on the existing network channel and the newly created network channel, the receiving of the target data. In another possible implementation, the network controller may alternatively create a new network channel for the target cluster directly, and when the quantity of network channels reaches an upper limit, the network controller further increases a network bandwidth of each network channel, or the like. In this embodiment, a specific implementation in which the network controller increases the network bandwidth for the target cluster is not limited.
Further, after the target cluster completes the receiving of the target data, if the target cluster currently does not have another data transmission task, or the another data transmission task in the target cluster has a low network bandwidth requirement, the proxy module 102 may further indicate the management module 101 to request the network controller to decrease the network bandwidth of the target cluster. In this way, a waste of a bandwidth resource in the computing network can be reduced.
In addition, when the third duration Tq′ is greater than the estimated first duration Tq, and the difference between the third duration Tq′ and the first duration Tq is greater than the preset value, it indicates that the time consumed by the target cluster to schedule the resource for the job is long (which exceeds the estimated first duration Tq). In this case, the proxy module 102 may indicate the management module 101 to request the network controller to decrease the network bandwidth used by the target cluster to receive the target data, or decrease the quantity of network channels of the target cluster. Correspondingly, time consumed by the target cluster to receive the target data increases correspondingly. In this way, after scheduling the resource for the job, the target cluster can further complete, at a close moment, the receiving of the target data, so that bandwidth resource consumption in the computing network can be reduced by decreasing the network bandwidth of the target cluster under a condition that the resource allocated by the target cluster to the job is not idle.
In this embodiment, the network bandwidth of the target cluster is flexibly adjusted, so that a waste of a network resource can be reduced and job processing efficiency is improved.
In the foregoing embodiment shown in
S601: A management module 101 obtains a plurality of bandwidth adjustment requests that are sent by a proxy module 102 and that are for different jobs in a target cluster, where each bandwidth adjustment request includes indication information for adjusting a bandwidth of the target cluster.
In this embodiment, there may be a plurality of jobs in the target cluster, and the target cluster may concurrently perform a data transmission process for the plurality of jobs, to simultaneously receive data separately required for executing the plurality of jobs. In an actual scenario, data volumes of data required for executing the different jobs are different. As a result, different jobs may have different requirements on the network bandwidth of the target cluster. For example, a volume of data required for executing a job A is 10 megabytes (MB), and the network bandwidth of the target cluster may be required to be decreased to reduce a waste of a bandwidth resource. However, a volume of data required for executing a job B is 1 gigabyte (GB) or the like, and the network bandwidth of the target cluster may be required to be increased to reduce time consumed for data transmission in the target cluster. For another example, after data transmission is completed, a job P may require the network bandwidth of the target cluster to be decreased to reduce a waste of a bandwidth resource. However, before data transmission is performed, a job Q may require the network bandwidth of the target cluster to be increased to reduce time consumed for the data transmission in the target cluster.
The indication information that is for adjusting the bandwidth of the target cluster and that is carried in the bandwidth adjustment request may be, for example, a positive value or a negative value. In addition, when the indication information is the positive value, it indicates to increase the bandwidth of the target cluster, and a bandwidth increase amplitude is the positive value. When the indication information is the negative value, it indicates to decrease the bandwidth of the target cluster, and a bandwidth decrease amplitude is an absolute value of the negative value. In another embodiment, the indication information in the bandwidth adjustment request may alternatively be implemented by adjusting a direction and a size, and indicate to increase the bandwidth of the target cluster.
In an implementation example, the proxy module 102 in the target cluster may respectively generate the plurality of different bandwidth adjustment requests for the different jobs, and send the plurality of bandwidth adjustment requests to the management module 101, so that the management module 101 requests the network controller to perform corresponding adjustment on the network bandwidth of the target cluster.
S602: The management module 101 obtains, through calculation, an update volume of the network bandwidth of the target cluster based on the plurality of bandwidth adjustment requests.
During specific implementation, the management module 101 may classify, based on the indication information that is included in the plurality of bandwidth adjustment requests and that is for adjusting the bandwidth of the target cluster, the plurality of bandwidth adjustment requests into a bandwidth expansion category and a bandwidth reduction category; calculate a total expansion value of the bandwidth of the target cluster based on one or more bandwidth adjustment requests of the bandwidth expansion category; and calculate a total reduction value of the bandwidth of the target cluster based on one or more bandwidth adjustment requests of the bandwidth reduction category, so that the management module 101 may calculate a difference between the total expansion value and the total reduction value. The difference is the update volume of the network bandwidth of the target cluster. In addition, when the difference is greater than 0, the management module 101 determines to increase the network bandwidth of the target cluster, and a bandwidth increase volume is the difference. When the difference is less than 0, the management module 101 determines to decrease the network bandwidth of the target cluster, and a bandwidth decrease volume is an absolute value of the difference.
During actual application, the management module 101 may receive a plurality of bandwidth adjustment requests for a same job. For example, when there is a delay or another exception in a communication network between the proxy module 102 and the management module 101, the proxy module 102 may repeatedly send a plurality of bandwidth adjustment requests to the management module 101, to ensure that the management module 101 can receive the bandwidth adjustment request sent by the proxy module 102. Therefore, after obtaining the plurality of bandwidth adjustment requests, the management module 101 may first filter the plurality of bandwidth adjustment requests, to filter out a repeated bandwidth adjustment request for a same job, and then obtain the update volume of the network bandwidth of the target cluster based on a remaining bandwidth adjustment request.
In addition, because the management module 101 is usually responsible for job scheduling within an entire computing network, the management module 101 may receive bandwidth adjustment requests for jobs in different clusters. Therefore, the management module 101 may further classify, based on the clusters, the plurality of obtained bandwidth adjustment requests, and determine one or more bandwidth adjustment requests that belong to each cluster, to adjust the network bandwidth of the target cluster based on a bandwidth adjustment request that belongs to the target cluster.
Then, the management module 101 may adjust the network bandwidth of the target cluster based on the calculated update volume. Specifically, this embodiment may further include the following steps.
S603: The management module 101 determines, based on the update volume, whether to perform expansion or reduction on the network bandwidth of the target cluster. In addition, when expansion is required on the network bandwidth of the target cluster, step S604 is performed. When reduction is performed on the network bandwidth of the target cluster, step S610 is performed.
S604: The management module 101 determines whether a network bandwidth of a current network channel of the target cluster reaches an upper limit. If the network bandwidth of the current network channel of the target cluster reaches the upper limit, step S607 is performed. If the network bandwidth of the current network channel of the target cluster does not reach the upper limit, step S605 continues to be performed.
S605: The management module 101 requests, based on the update volume, the network controller to increase the network bandwidth of the current network channel of the target cluster.
S606: The management module 101 determines whether a volume of this bandwidth adjustment matches the update volume. If the volume of the bandwidth adjustment matches the update volume, this bandwidth adjustment ends. If the volume of the bandwidth adjustment does not match the update volume, step S607 continues to be performed.
In some scenarios, the network bandwidth of one or more current network channels of the target cluster may not reach the upper limit. However, after the network channel is expanded to the upper limit, a total expansion volume of the bandwidth of the target cluster may still be less than the update volume. In this case, it is difficult to meet a network bandwidth adjustment objective of the target cluster based on the existing network channel. Therefore, step S607 may continue to be performed to expand a remaining part of the network bandwidth of the target cluster.
S607: The management module 101 requests the network controller to determine whether a network channel can be added to the target cluster. If the network channel can be added to the target cluster, step S608 continues to be performed. If the network channel cannot be added to the target cluster, step S609 is performed.
S608: The management module 101 requests the network controller to create a new network channel for the target cluster, and returns to perform step S606.
S609: The management module 101 determines that the network bandwidth for the target cluster has been adjusted to the upper limit.
During actual application, the management module 101 may notify the proxy module 102 deployed in the target cluster that the network bandwidth of the target cluster has been adjusted to a maximum value, and the bandwidth of the target cluster network cannot be further expanded.
S610: The management module 101 determines, based on the update volume, a network channel that needs to be released.
For example, it is assumed that the target cluster currently includes a network channel 1, a network channel 2, and a network channel 3, network bandwidths of the network channel 1, the network channel 2, and the network channel 3 are respectively 100 megabits per second (Mbps), 200 Mbps and 500 Mbps, and the update volume is (to decrease by) 100 Mbps. In this case, the scheduler may determine to release the network channel 1, to decrease the network bandwidth of the target cluster by 100 Mbps.
S611: The management module 101 requests the network controller to release the determined network channel.
S612: The management module 101 determines whether a volume of this bandwidth adjustment matches the update volume. If the volume of the bandwidth adjustment matches the update volume, this bandwidth adjustment ends. If the volume of the bandwidth adjustment does not match the update volume, step S613 continues to be performed.
S613: The management module 101 determines whether a network bandwidth of a remaining network channel of the target cluster reaches a lower limit. If the network bandwidth of the remaining network channel of the target cluster reaches the lower limit, this network bandwidth adjustment ends. If the network bandwidth of the remaining network channel of the target cluster does not reach the lower limit, step S614 continues to be performed.
When the network bandwidth of the remaining network channel of the target cluster reaches the lower limit, it indicates that the network channel of the target cluster has reached the lower limit for releasing, and a bandwidth of each remaining network channel reaches the lower limit.
S614: The management module 101 requests the network controller to perform reduction on the target cluster, to implement reduction on the remaining part of the network bandwidth of the target cluster.
For example, it is assumed that the target cluster currently includes a network channel 1, a network channel 2, and a network channel 3, bandwidths of the network channel 1, the network channel 2, and the network channel 3 are respectively 100 Mbps, 200 Mbps and 500 Mbps, and the update volume is assumed to be 180 Mbps. In this case, after the network channel 1 is released, a reduction quantity of the network bandwidth of the target cluster is only 100 Mbps, and does not reach 180 Mbps. Therefore, the scheduler may request the network controller to continue to perform reduction on the target cluster. For example, the network bandwidth of the network channel 2 is reduced from 200 Mbps to 120 Mbps. Alternatively, the network bandwidth of the network channel 3 is reduced from 500 Mbps to 420 Mbps. In this way, a total reduction quantity of the network bandwidth of the target cluster reaches 180 Mbps.
The foregoing describes in detail the job scheduling method provided with reference to
Specifically, the management module 701 is configured to: obtain a to-be-processed job; determine, from the plurality of clusters, a target cluster for processing the job; and deliver the job to the proxy module 702.
The proxy module 702 is configured to indicate the target cluster to schedule a resource for the job, and obtain target data in a process of scheduling the resource for the job, where the target data is data required for executing the job.
In a possible implementation, when determining, from the plurality of clusters, the target cluster for processing the job, the management module 701 is further configured to: estimate first duration in which each of the plurality of clusters schedules a resource for the job; calculate second duration in which each of the plurality of clusters obtains the target data; use a larger value in the first duration and the second duration as waiting duration for the cluster to process the job; and use a cluster with smallest waiting duration in the plurality of clusters as the target cluster.
Optionally, the management module 701 may alternatively schedule, based on load of each cluster, the job to a cluster with smallest load for processing, to implement load balancing in a computing network.
In a possible implementation, the management module 701 is further configured to: estimate first duration in which the target cluster schedules the resource for the job; calculate second duration in which the target cluster obtains the target data; and send the first duration and the second duration to the proxy module 702.
When indicating the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job, the proxy module 702 is further configured to: when the first duration is greater than the second duration, indicate the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job.
Optionally, after the management module 701 delivers the job to the proxy module 702, the proxy module 702 may alternatively estimate first duration in which the target cluster schedules the resource for the job, and calculate second duration in which the target cluster obtains the target data, to indicate, based on the first duration and the second duration, the target cluster to obtain the target data in the process of scheduling the resource for the job.
In a possible implementation, the management module 701 is further configured to: estimate first duration in which the target cluster schedules the resource for the job; calculate second duration in which the target cluster obtains the target data; and send the first duration and the second duration to the proxy module 702.
When indicating the target cluster to schedule the resource for the job, and obtain the target data in the process of scheduling the resource for the job, the proxy module 702 is further configured to: when the first duration is not greater than the second duration, indicate, at a first moment before indicating the target cluster to schedule the resource for the job, the target cluster to start to obtain the target data, and indicate, at a second moment, the target cluster to schedule the resource for the job, where duration of an interval between the first moment and the second moment is the second duration minus the first duration.
In a possible implementation, when estimating the first duration in which the target cluster schedules the resource for the job, the management module 701 is further configured to: determine a target category to which the job belongs; calculate average duration in which the target cluster schedules a resource for a historical job of the target category; obtain a currently available resource ratio and a historically available resource ratio that are of the target cluster, where the currently available resource ratio is a ratio of a resource quantity of currently available resources of the target cluster to a resource quantity of total resources, and the historically available resource ratio is a ratio of an average resource quantity of available resources of the target cluster in a time period before the target cluster schedules the resource for the job to the resource quantity of total resources; and estimate, based on the average duration, the currently available resource ratio, and the historically available resource ratio, the first duration in which the target cluster schedules the resource for the job.
In a possible implementation, the target category is determined based on one or more of a category of a requested resource, a quantity of requested resources, a volume of data on which the job depends, an application to which the job belongs, a job priority, a queue in which the job is located, and a calculation instance to which the job belongs.
In a possible implementation, the proxy module 702 is further configured to: monitor third duration in which the target cluster schedules the resource for the job, and indicate, based on the third duration and the first duration, the management module 701 to send an adjustment instruction to a network controller of the target cluster, where the adjustment instruction instructs the network controller to adjust a network bandwidth of the target cluster or adjust a quantity of network channels of the target cluster.
In a possible implementation, when the third duration is less than the first duration, and a difference between the first duration and the third duration is greater than a preset value, the adjustment instruction instructs the network controller to increase the network bandwidth of the target cluster or increase a quantity of network channels of the target cluster.
In a possible implementation, when the third duration is greater than the first duration, and a difference between the third duration and the first duration is greater than a preset value, the adjustment instruction instructs the network controller to decrease the network bandwidth of the target cluster or decrease a quantity of network channels of the target cluster.
In a possible implementation, the management module 701 and the proxy module 702 are deployed on one scheduler, and the scheduler is connected to the plurality of clusters.
In a possible implementation, the management module 701 is deployed on a scheduler, and the proxy module 702 is deployed in the target cluster.
The scheduler 700 shown in
It should be understood that, in this embodiment, the processor 801 may be a CPU. Alternatively, the processor 801 may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or another programmable logic device, a discrete gate or a transistor logic device, a discrete component assembly, or the like. The general-purpose processor may be a microprocessor, another processor, or the like.
The memory 802 may include a read-only memory and a random access memory, and provide instructions and data to the processor 801. The memory 802 may further include a nonvolatile random access memory. For example, the memory 802 may further store information about a device type.
The memory 802 may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory may be a random-access memory (RAM), and is used as an external cache. By way of example and not limitation, many forms of RAMs may be used, for example, a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate (DDR) SDRAM, an enhanced SDRAM (ESDRAM), a synchronous link DRAM (SLDRAM), and a direct Rambus (DR) RAM.
The memory 802 stores executable code. The processor 801 executes the executable code to perform the method performed by the foregoing management module 101, perform the method performed by the foregoing proxy module 102, or perform the method performed by the foregoing management module 101 and proxy module 102.
Specifically, when embodiments shown in
It should be understood that the scheduler 800 in this embodiment may correspond to the scheduler 700 in embodiments, and may correspond to the management module 101 and the proxy module 102 in the methods shown in
In addition, an embodiment further provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a scheduler, the scheduler is enabled to perform the method performed by the management module 101 and the proxy module 102 in the foregoing embodiments.
In addition, an embodiment further provides a computer program product. When the computer program product is executed by a scheduler, the one or more schedulers perform any one of the foregoing job scheduling methods. The computer program product may be a software installation package. When the any one of the foregoing job scheduling methods needs to be used, the computer program product may be downloaded, and the computer program product may be executed on a computer.
In addition, it should be noted that the apparatus embodiments described above are merely examples. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. A part or all of the modules may be selected based on actual requirements to achieve the objectives of the solutions of embodiments. In addition, in the accompanying drawings of the apparatus embodiments, connection relationships between modules indicate that the modules have communication connections with each other, which may be specifically implemented as one or more communication buses or signal cables.
In the specification, claims, and accompanying drawings, the terms “first”, “second”, and the like are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the terms used in this manner are interchangeable in proper circumstances, and this is merely a distinguishing manner used when objects with a same attribute are described in embodiments.
Based on the descriptions of the foregoing implementations, a person skilled in the art may clearly understand that this disclosure may be implemented by software in addition to necessary universal hardware, or by dedicated hardware, including a dedicated integrated circuit, a dedicated CPU, a dedicated memory, a dedicated component, and the like. Generally, any functions that can be performed by a computer program can be easily implemented by using corresponding hardware. Moreover, a specific hardware structure used to achieve a same function may be in various forms, for example, in a form of an analog circuit, a digital circuit, or a dedicated circuit. However, software program implementation is an optimal implementation in most cases. Based on such an understanding, the technical solutions of this disclosure may be implemented in a form of a software product. The computer software product is stored in a readable storage medium, for example, a floppy disk, a USB flash drive, a removable hard disk, an ROM, a RAM, a magnetic disk, or an optical disc on a computer, and includes several instructions for instructing a computer device (which may be a personal computer, a training device, or a network device) to perform the methods described in embodiments.
All or a part of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement embodiments, the foregoing embodiments may be implemented completely or partially in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or a part of the processes or the functions according to embodiments are generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a digital versatile disc (DVD)), or a semiconductor medium. The semiconductor medium may be a solid-state drive (SSD).
The foregoing descriptions are merely specific embodiments, but are not intended to limit the protection scope of this disclosure. Any modification or replacement readily figured out by a person skilled in the art within the technical scope disclosed shall fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure shall be subject to the protection scope of the claims.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202210988472.7 | Aug 2022 | CN | national |
This is a continuation of Int'l Patent App. No. PCT/CN2023/101278, filed on Jun. 20, 2023, which claims priority to Chinese Patent App. No. 202210988472.7, filed on Aug. 17, 2022, both of which are incorporated by reference.
| Number | Date | Country | |
|---|---|---|---|
| Parent | PCT/CN2023/101278 | Jun 2023 | WO |
| Child | 19053806 | US |