Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 20

Cloud Resource Scheduling Essentials

Recommended resources

Introduction

In our last lesson, you learned how a load balancer distributes incoming user traffic across a pool of servers, which is essential for horizontal scaling and high availability. We focused on directing external requests to the right server.

Now, we will shift our focus from the external traffic to the internal workings of the cloud. Once a cloud provider has a set of provisioned resources (like physical servers and the virtual machines running on them), how does it decide which specific task or computation runs on which specific resource? This is the core question of resource scheduling.

Today's learning outcome is to explain the purpose of resource scheduling in a cloud environment to efficiently assign tasks to resources. We will define resource scheduling, distinguish it from related concepts, and explore the fundamental algorithms that cloud systems use to manage workloads effectively. This is a critical concept for your exams as it explains how a cloud provider delivers on its promise of efficiency and performance.


Defining Resource Scheduling

First, let's establish a clear, exam-ready definition.

Definition: Resource Scheduling is the process of mapping a set of tasks (also known as jobs or cloudlets) onto a set of available resources (such as Virtual Machines, CPUs, or memory) to satisfy specific performance objectives. Its primary purpose is to generate an optimal schedule that decides which tasks run on which resources, and in what order.

It's crucial to distinguish this from two other concepts:

  1. Resource Provisioning: This is about allocating or creating the resources in the first place (e.g., launching a new VM). We discussed this in a previous lesson.
  2. Load Balancing: This is about distributing incoming network traffic from users across multiple servers.

Scheduling, on the other hand, is about assigning the computational work within the cloud to the provisioned resources.

This diagram clearly shows the distinction. Provisioning gets the resources ready, and scheduling puts them to work.

Cloud Resource Provisioning and Scheduling Workflow
This diagram illustrates the cloud resource management process. Notice the clear separation between 'Resource Provisioning' (acquiring the resources) and 'Resource Scheduling' (mapping, allocating, and executing workloads on those resources).

The Purpose and Objectives of Resource Scheduling

The central purpose of resource scheduling is efficiency. In a multi-tenant cloud environment with thousands of competing tasks, an effective scheduling strategy is vital for both the cloud provider (to maximize profit and utilization) and the cloud consumer (to get the best performance and lowest cost).

To achieve this, scheduling algorithms aim to optimize several key objectives, often referred to as Quality of Service (QoS) metrics.

Types of Task Scheduling Algorithms in Cloud Computing ...

For a formal list of these objectives, we can turn to the paper 'Types of Task Scheduling Algorithms in Cloud Computing'.

Read the subsection titled 'Task scheduling algorithms advantages'. It provides a concise, bulleted list of the goals that a good scheduling algorithm strives to achieve. This is excellent material for an exam answer.

Based on that reading and standard cloud computing principles, here are the primary objectives of resource scheduling:

  • Maximize Resource Utilization: Ensure that expensive hardware (CPUs, RAM, storage) does not sit idle. High utilization means the provider is getting the most value from its infrastructure.
  • Minimize Makespan: Makespan is the total time elapsed from the start of the first task to the completion of the last task in a set. The goal is to finish the entire batch of work as quickly as possible.
  • Minimize Waiting Time / Response Time: Reduce the time a task spends waiting in a queue before it is executed. This directly impacts application responsiveness for the end-user.
  • Achieve Load Balancing: Distribute tasks evenly across available resources to prevent any single resource from becoming a bottleneck while others are underutilized.
  • Ensure Fairness: Prevent a situation where some tasks (e.g., very long jobs) are constantly postponed or "starved" of resources while other tasks run. Every task should eventually get its turn to execute.
  • Adhere to QoS/SLA: Meet the promises made in the Service Level Agreement (SLA), such as guarantees on completion time, cost, or task priority.

How Scheduling Works: Algorithms and Strategies

To achieve the objectives listed above, cloud management systems employ various scheduling algorithms. You might recognize some of these from your study of Operating Systems, as the principles are similar.

Scheduling algorithms can be broadly classified based on several criteria. For your exams, the most important distinction is Static vs. Dynamic.

  • Static Scheduling: Scheduling decisions are made before the tasks begin execution. This approach requires prior knowledge about the tasks (e.g., their expected runtime) and the resources. It is simpler but less adaptable to the changing conditions of a real-time cloud environment.
  • Dynamic Scheduling: Scheduling decisions are made on-the-fly as tasks arrive. This approach considers the current state of the system (e.g., which VMs are busy) and can adapt to unpredictable workloads. It is more complex but far more effective in a shared cloud environment.

Let's explore a few fundamental algorithms. The paper "A Survey on Resource Scheduling Algorithms in Cloud Computing" provides a great overview of these foundational methods.

[PDF] A Survey on Resource Scheduling Algorithms in Cloud Computing

This survey paper gives a quick introduction to the classic scheduling algorithms that were adapted from grid and cluster computing for the cloud.

Read the paragraph right before section 'A. Deterministic/ Linear Approaches...' (starts with 'In earlier days...'). This paragraph lists FCFS, Round Robin, Min-Min, and Max-Min. Then, briefly look at Table I, which summarizes various deterministic approaches.

Here is a comparative summary of the most common scheduling algorithms you should know for your exams.

Algorithm Principle Advantages Disadvantages Type
First-Come, First-Served (FCFS) Tasks are placed in a queue and executed in the order they arrive. Simple to implement and inherently fair based on arrival sequence. Inefficient. A long-running task can block all subsequent tasks (the "convoy effect"), increasing the average waiting time. Static, Non-Preemptive
Shortest Job First (SJF) The scheduler selects the task with the shortest estimated execution time to run next. Provably optimal in minimizing the average waiting time for all tasks. Can lead to starvation for longer tasks if a continuous stream of short tasks arrives. Requires knowing task length in advance. Static, Non-Preemptive
Round Robin (RR) Each task is assigned a fixed time slice (quantum) to execute. Tasks run in a circular queue. If a task isn't finished in its time slice, it goes to the back of the queue. Very fair, as no task has to wait for another to finish completely. Good for interactive systems. Performance is sensitive to the quantum size. Too large, and it becomes like FCFS; too small, and the overhead of switching between tasks becomes too high. Dynamic, Preemptive
Max-Min The scheduler identifies the largest task and assigns it to the resource that can finish it the fastest. This process is repeated. Ensures that large, resource-intensive tasks are not starved and can run concurrently with smaller tasks. Smaller tasks may have to wait for large tasks to be scheduled first, potentially increasing their individual wait times. Static, Non-Preemptive

This diagram provides a high-level taxonomy of the vast number of scheduling techniques. The algorithms we just discussed fall under the "Heuristic" category.

Taxonomy of Job Scheduling Techniques in Cloud Computing
This flowchart shows the wide variety of job scheduling techniques in cloud computing. Our focus on algorithms like FCFS and SJF falls under the 'Heuristic' category within 'Task Scheduling', which aims to optimize metrics like makespan and execution time.

Conclusion

In this lesson, we have defined the purpose and function of resource scheduling in a cloud environment. While load balancing manages traffic from the outside world, resource scheduling is the internal discipline of efficiently assigning work to the available computing resources.

Key Takeaways:

  • Resource Scheduling is the process of mapping tasks to resources to optimize for specific objectives.
  • It is distinct from resource provisioning (creating resources) and load balancing (distributing external traffic).
  • The primary purpose is to improve efficiency by maximizing resource utilization, minimizing task completion time (makespan), and maintaining Quality of Service (QoS).
  • Scheduling algorithms can be static (pre-planned) or dynamic (real-time and adaptive).
  • Fundamental algorithms like FCFS, SJF, Round Robin, and Max-Min provide different trade-offs between simplicity, fairness, and overall system throughput.

Preview of the Next Lesson:

Now that we understand how tasks are scheduled onto resources, a logical next question is: how do we know if the scheduling is effective and if the resources are performing well? In our next lesson, we will cover resource monitoring, where we will define its purpose and list the key performance metrics that need to be tracked in a cloud environment.