83
TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT (HRRN) ALGORITHM IN CLOUD COMPUTING WITH CLOUDSIM AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of Informatics and Computing University Sultan Zainal Abidin, Terengganu, Malaysia SEPTEMBER 2019

TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT

(HRRN) ALGORITHM IN CLOUD COMPUTING WITH CLOUDSIM

AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN

Bachelor of Computer Science (Computer Network Security)

Faculty of Informatics and Computing

University Sultan Zainal Abidin, Terengganu, Malaysia

SEPTEMBER 2019

Page 2: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

i

DECLARATION

I hereby declare that this report is based on my original work except for quotations and citations, which

have been duly acknowledged. I also declare that it has not been previously or concurrently submitted for

any other degree at Universiti Sultan Zainal Abidin or other institutions.

Name: Ahmad Aqil Izzuddin Bin Mohd Zulkurnin

Date: ………………………………………………

Page 3: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

ii

CONFIRMATION

I have read this report and in my point of view, this project has fulfilled a condition to be awarded a Bachelor

of Computer Science (Computer Network Security) with Honours.

Name: Dr. Wan Nor Shuhadah Binti Wan Nik

Date: ………………………………………….

Page 4: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

iii

DEDICATION

In the name of Allah, the most gracious and the most merciful, I thank Allah, all praise to Allah who has

guided me and giving me the strength to proceed and finish, to submit the report in due time and without

whom help this study which required untiring effort would have not been possible to complete with a time

limit. On this special opportunity is given to me, I would like to express my gratitude to my supervisor, Dr.

Wan Nor Shuhadah Binti Wan Nik for her supervision and inspiration throughout my final year project.

Next, my thanks go to both of my parents that help me in a various way in order to ensure I can complete

my project whether in moral support and financial support. Last but not least, to my classmates and course

mates that always helps in many ways in order to help me complete the project within the time given.

Page 5: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

iv

ABSTRACT

Cloud Computing system is the most important for any organization to do any task in the real world

today. Cloud computing also offering utility-oriented IT services to users worldwide. It enables the hosting

of applications from a consumer, scientific, and business domains. Besides that, cloud computing is most

of the popular choice of a computing system. It provided some benefits such as low cost for implementation

of a cloud computing system. It is also related to the computer system performance, that any organization

needs the best performance such as resource utilization, time-sharing response, and troughput to do any

kind of task. CPU becomes idle and overheating will be affected the computer system performance. So, we

need to find the best optimal value of CPU utilization and Cloudsim is the best tool that can be used.

Cloudsim is a cloud simulation tool that is used in the overall implementation Cloudlet scheduling

algorithm. This proposal is focused on comparing the default scheduling algorithm with the new scheduling

algorithm that will be implemented in the cloudsim simulator. The default scheduling algorithm used in the

cloudsim simulator is First Come First Serve (FCFS), Round Robin (RR), and Shortest Job First (SJF), and

the new Scheduling algorithm that will be implemented is the Highest Response Ratio Next (HRRN)

algorithm. These four scheduling algorithms will be compared to find which one is the better of the

scheduling algorithm to get the optimal value of the CPU utilization.

Page 6: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

v

CONTENTS

CONTENTS PAGE

DECLARATION I

CONFIRMATION II

DEDICATION III

ABSTRACT IV

CONTENT V

LIST OF TABLES IX

LIST OF FIGURES X

LIST OF ABBREVIATIONS XI

LIST OF APPENDICES XII

Chapter 1

Introduction

1.1 Background 1

1.2 Problem Statement 3

1.3 Objective 3

1.4 Scope 4

1.5 Academic Value 4

1.6 Limitation of Work 4

1.7 Summary

Page 7: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

vi

Chapter 2

Literature Review

2.1 Introduction 6

2.2 Resources Scheduling in Cloud Computing 7

2.3 Resource Scheduling Algorithm 8

2.4 Load Balancing in Cloud Computing 10

2.5 What is Cloudsim 13

2.6 Summary 16

Chapter 3

Methodology

3.1 Introduction 17

3.2 Framework of Resource Scheduling 18

3.3 Cloud Computing Scheduling Model 19

3.4 Design of Cloudsim 21

3.5 Cloudsim Model 23

3.6 Scheduling Algorithm 24

3.6.1 FCFS Algorithm 24

3.6.2 Flowchart of FCFS Algorithm 25

3.6.3 Psuedocode of FCFS Algorithm 26

3.6.4 HRRN Algorithm 27

3.6.5 Flowchart of HRRN Algorithm 28

3.6.6 Psuedocode of HRRN Algorithm 29

3.6.7 RR Algorithm 30

Page 8: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

vii

3.6.8 Flowchart of RR Algorithm 31

3.6.9 Pseudocode of RR Algorithm 32

3.6.10 SJF Algorithm 33

3.6.11 Flow of SJF Algorithm 34

3.6.12 Psuedocode of SJF Algorithm 35

3.7 Software and Hardware 36

3.8 Summary 37

Page 9: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

viii

Chapter 4

Implementation and Result

4.1 Create Cloudsim Project Simulation Toolkit 39

4.2 Make changes in Scheduling algorithm and Resource Allocation algorithm 45

4.3 Make Changes of Scheduling Process in Cloudsim 50

4.4 Output of Scheduling algorithm in Cloudsim toolkit 56

4.5 Result of Resources Scheduling algorithm of Response Time 60

4.6 Graph Analysis of Resources Scheduling Algorithm in Cloudsim 62

Chapter 5

Conclusion

5.1 Introduction 64

5.2 Project Contribution 64

5.3 Result Discussion 65

5.4 Problems and Limitations 66

5.5 Future Works 67

5.6 Conclusion 67

Reference 68

Appendices 69

Page 10: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

ix

LIST OF TABLES

TABLE TITLE PAGE

2.0 Comparison of Resources Scheduling Algorithm 8

2.1 Advantages and Disadvantages of Static Load Balancing 11

2.2 Advantages and Disadvantages of Dynamic Load Balancing 12

4.1 Response Time of Scheduling in Cloudsim 60

4.2 Average Response Time in Cloudsim 61

Page 11: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

x

LIST OF FIGURES

FIGURE TITLE PAGE

2.1 Cloudsim Architecture 14

3.1 Resource Scheduling Framework in Workload Management System 18

3.2 Cloud Computing Scheduling Model 19

3.3 Cloudsim Class Diagram 21

3.4 Cloudsim Model Diagram 23

3.5 Flowchart of the First-come-First-Serve algorithm 25

3.6 Flowchart of HRRN algorithm 28

3.7 Flowchart of RR algorithm 31

3.8 Flowchart of SJF 34

4.1 Interface of NetBeans application 39

4.2 Create new project 40

4.3 Enter the Project file’s name 41

4.4 Import jars file of Cloudsim into NetBeans program 42

4.5 Select Jars File of Cloudsim 43

4.6 Output with existing example code from Cloudsim 44

4.7 Import Class Scheduler java file 46

4.8 Main Class in Scheduler. Java 49

4.9 Output of FCFS task Scheduling 56

4.10 Output of HRRN task Scheduling 57

4.11 Output of RR task Scheduling 58

4.12 Output of SJF task Scheduling 59

4.13 Analysis of Resources Scheduling in Cloudsim 62

4.14 Average Response Time in Resources Scheduling of Cloudsim 63

Page 12: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

xi

LIST OF ABBREVIATIONS/ TERMS/ SYMBOLS

CPU Central Processing Unit

FCFS First Come First Serve

SJF Shortest Job First

RR Round Robin

HRRN Highest Response Ratio Next

OS Operating System

Page 13: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

xii

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Ganchart 69

Page 14: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

1

CHAPTER 1

INTRODUCTION

1.1 Background

The cloud computing system is the most important for any organization to do any task in the real

world. Cloud computing delivers infrastructure, platform, and software (application) as services. These

services in the industry are respectively referred to as Infrastructure as a Service (Iaas), Platform as a Service

(Paas), and Software as a Service (Saas). Prof, Patterson in the Berkeley Report [1] stated: “Cloud

Computing, is the long-held dream of computing as a utility, has the potential to transform a large part of

the IT industry and making the software even more attractive as a service”. Next is a Cloud-based. Cloud-

based is an application, service, or resource that made available to the user on-demand via the internet from

cloud computing provider services. The cloud-based application included social networking, web hosting,

content delivery, and real-time instrumented data processing. Each of these application types has a different

composition, configuration, and deployment requirements.

Scheduling jobs in the cloud is a big challenge nowadays. As if jobs are cloudlets. It scheduled

properly then the resource allocation or energy will be minimized significantly. Simulation is one of the

ways that may help to discover a solution and detect the problem that had or possibly occur in the system.

This thesis consists of a method that will improve the overall cloudlet allocation based on CPU utilization.

It is being compared with the existing cloudlet scheduling algorithm which is used by the Cloudsim with

the new scheduling algorithm that will be plug-in in the Cloudsim simulator. Cloudsim is the simulation

tool that is used in the overall implementation Cloudlet scheduling algorithm.

Page 15: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

2

A comparison of the algorithm is proposed for parameter performance in terms of resource utilization which

is the CPU utilization. It will be assigned the task to the scheduler in more efficient and increase computer

performance.

The default algorithm in cloudsim commonly use for CPU Scheduling is First Come First

Serve (FCFS), Round Robin (RR), Shortest Job First (SJF). The Highest Response Ratio Next algorithm

(HRRN) is the new scheduler algorithm that will be implemented in the Cloudsim simulator. It will be

compared with the default algorithm scheduler and at the end of the project is to analyze which algorithm

is best for scheduling to get the best performance in terms of resource utilization.

Page 16: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

3

1.2 Problem Statement

● To find the optimal value CPU utilization to prevent the computer processor from idle and

overheating.

● The wrong Allocation of job Scheduling does affect the performance of the computer due

to unable to create a parallel and synchronized process that occurs at a time.

● The inflexibility of scheduling algorithms will cause longer processing time which further

degrades system performance. which had constraints on the scheduling algorithm.

1.3 Objectives

● To study the resource scheduling algorithms using a CloudSim simulator.

● To implement different scheduling algorithms into the cloud computing simulation

environment in achieving optimal resource utilization.

● To analyze the performance of the Highest Response Ratio Next algorithm (HRRN) for

scheduling problems using Cloudsim and compare to other traditional scheduling

algorithms (i.e. FCFS ) in terms of resource utilization.

Page 17: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

4

1.4 Scope

● Analyze and research the default scheduling algorithm with a new scheduling algorithm

implemented in Cloudsim.

● Record the resource utilization by plotting some graphs and identify better scheduling

algorithm in achieving an optimal resource utilization.

1.5 Academic Value

● The process of study and understanding of the Cloudsim architecture.

● The process of study on a new Scheduling algorithm like i.e. Highest Response Ratio Next

(HRRN) algorithm as a scheduling algorithm that has been implemented in the Cloudsim

simulator.

1.6 Limitation of work

● Limited time to study the whole concept of the HRRN algorithm to be implemented in the

Cloudsim simulator.

● The implementation of a scheduling algorithm in the simulation environment in real-time

computer performance cannot be similar to simulation performance.

● The implementation of scheduling in the real world is difficult and costly to do.

Page 18: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

5

1.7 Summary

This chapter describes a few topics included in the introduction of the project such as the

background of the project, the problem statement, objective for this project, scope, and the limitation of

work. Thus it helps to organize better documentation of the project.

Page 19: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

6

CHAPTER 2

Literature Review

2.1 Introduction

This chapter focuses on the process of analyzing the information gathered about the topic which

is in the context of resource scheduling and cloud computing simulation based on the sources find which

is an article journal and few theses that discuss deeper on the simulation of cloud computing and resource

scheduling. The outcome of the information gathering will be analyzed, some constraints and limitations

of the existing project will be determined and few improvements will be applied in the project.

Besides that, the different tools also used and a few approaches are taken that will be discussed in

this chapter. The comparison between existing resources scheduling techniques and approach that is

adapted into a cloud computing environment will be discussed in another topic. Based on the comparison

that reviewed on the above points, a combination of techniques and approaches, software, and tools could

produce a better version in terms of resources scheduling to be implemented into the cloud computing

system. Other than that, the difference between metaheuristic and heuristic algorithms in scheduling will

be discussed in this chapter.

Page 20: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

7

2.2 Resource Scheduling in Cloud Computing

Junho Lee 2012 proposed a resource allocation and scheduling in heterogeneous cloud computing

in order to solve the management resources problem that arises in order for the provider to achieve

maximum utilization of resources and for a user to get application performance requirements with minimum

expenditure[2]. By utilizing the MapReduce software framework which able to support data-intensive

Computations on large clusters.

Due to one of the drawbacks of cloud computing which is the assumptions of a homogeneous

environment. Hadoop [3] assumes that all nodes participating in the cluster have the same processing power.

When Hadoop schedule the task of a job, it considers network connectivity by giving preference to the task

that access local data over these access remote data but does not consider the difference in computing

capability of nodes. This is different compared to heterogeneous that can run tasks faster on the particular

node compared to others

Page 21: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

8

2.3 Resource Scheduling Algorithm

There are few scheduling algorithms available in the computer resourcing for CPU utilization. In

this section, a few comparisons will be analyzed to propose the best scheduling algorithm in terms of lower

response time. Thus Table 1 that consists of the approaches, and techniques used in the research and

advantages and disadvantages of the research is being documented in a table form.

No

Algorithm/ Technique/ Approaches

Advantages

Disadvantages

1

First Come First Server (FCFS)[4]

● Doesn’t include any

complex logic

● Simple and easy to

implement.

● Starvation doesn’t occur

● No option for pre-

emption of a process

● The next process

wait for along time

to be executed their

process

2

Short Job First (SJF)[5]

● short processes are

executed first

● Troughput increase (more

process can be executed in

less amount of time)

● Longer process

● More waiting time

● Starvation occurs

Page 22: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

9

3

Round Robin (RR)

● Starvation doesn’t

occur(every process is

given a fixed time to

execute)

● No process is left behind

● If time quantum is

shorter than needed,

● Number of times that

CPU switches from

one process to another

process, increases.

This leads to a

decrease in CPU

efficiency.

4

Priority-based Scheduling

● The priority of process

selected based on memory

requirement, time

requirement or user

preference

● The second

scheduling algorithm

is required to schedule

the process which has

the same priority

● Starvation occurs

5

Highest Response Ratio

Next (HRRN)

● Improve both resource

utilization and job response

time.

● Unable to overcome

the server overflow

problem

Page 23: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

10

2.4 Load Balancing in Cloud Computing

Another approach in cloud computing that was found is to implement an efficient load Scheduling.

The researcher from this paper [6] did a survey on the already developed and defined load balancing

algorithms. As we know that the load balancing and scheduling are somehow related in the field of cloud

computing. Based on the author of this paper the load balancing algorithms are two types, Static load

balancing algorithm, and dynamic load balancing algorithm. The static load balancing algorithm does not

modify or change states at runtime but dynamic load balancing algorithms definitely do at run time. As we

all know that the Cloud Environment new resources keep on adding and the overall structure of the cloud

keeps on changing, therefore, static load balancing algorithms do not play a big role. To cope up with the

changing cloud environment the dynamic load balancing algorithms play a big role. This paper also defined

the challenges behind the load balancing in the cloud environment. Some of the main reason is:

● Spatial Distribution of the Cloud Nodes - Cloud is a distributed system, therefore, the

cloud nodes are spatially distributed over the geographical location, therefore, it becomes

a great challenge for designers of the load balancing algorithm to design the algorithms

keeping in mind the geographical location of the nodes. Fault Tolerance has to be taken

into account.

● Storage/ Replication - To improve the fault tolerance of the system data replication is the

way we go. It is not easy to manage such a huge amount of data. This huge amount of data

storing is not easy and fetching is also very difficult. Therefore, it is very important to

manage this huge amount of data properly to provide an adequate amount of services.

Page 24: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

11

● Algorithm Complexity - If the complexity of the algorithm is high, then the overall

turnaround time will increase. Therefore, it is very important for the load balancing

algorithms designers to do a proper trade-off between the algorithm complexity and the

overall complexity of the application.

● Point of Failure - If Cloud is using the centralized approach then one point of failure

becomes a big challenge, therefore, the solution to this problem is that the architecture of

the cloud must become decentralized.

A comparison of load balancer in cloud computing is proposed by Mohit Tomar (2017) which

involve round-robin and throttled to identify the better algorithm in term of performance in cloud computing

environment [7]. The results show that the throttled algorithm takes less time than the round-robin algorithm

to access data and that this difference is due to a faultiness in the implementation of the round-robin

algorithm. Mohit Tomar also states the differences between static and dynamic load balancing and some

benefits and drawback lies on both types of load balancing. Table 2.1 and Table 2.2 is the information that

can be extracted based on the research.

Table 2.1: Advantages and Disadvantages of a Static Load Balancing System

Page 25: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

12

Table 2.2: Advantages and Disadvantages of a Dynamic Load Balancing System

In terms of cloud computing, researcher Wayne A. Pauley Jr. (2012) conduct a study of security

and privacy assessments in a cloud computing environment [8]. This research is to compare privacy

assessment against the cloud provider environment. This research also highlights the weakness of the

current methodology of privacy assessment methodology that applied in a cloud computing environment

Page 26: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

13

2.5 What is Cloudsim?

Cloudsim is a simulation toolkit that used of Cloud computing scenarios. That allows cloud

developers to test and analyze the performance of Cloud computing resources. It describing essential classes

such as data centers, computational resources, virtual machines, applications, users, and policies for the

management of various parts of the system such as scheduling and provisioning. It can be also put together

for users to evaluate new strategies in the utilization of clouds. Cloudsim is implemented in a java program

language using its component to compose the desired scenario [9]. Cloudsim was developed by a team of

a researcher under the guidance of Dr. Raj Kumar Buyya at Cloud Computing and Distributed System

(CLOUDS) at Laboratory, University of Melbourne.

Therefore, Cloudsim is the best choice as a cloud simulator to run through the criteria of schedule

which is the CPU utilization. All organizations need a good performance in the Cloud computing system.

The best CPU utilization is between 40% (lightly loaded) - 90% (heavily loaded) as an optimal CPU

utilization.

Page 27: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

14

Figure 2.1: CloudSim Architecture [10]

Figure 2.1 shows a layered structure of the cloudsim which consists of four levels such as

Simjava, Gridsim, Cloudsim, and user code.

Page 28: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

15

Simjava - Simjava discrete event simulation engine is the lowest layer in the cloudsim architecture. It

implements the core functionalities required for higher-level simulation frameworks such as queuing and

processing of events, creation of system components (services, host, data center, broker, virtual

machines), communication between components, and management of the simulation clock.

Gridsim - Gridsim toolkit that supports high-level software components for modeling multiple Grid

infrastructures, including networks and associated traffic profiles, and fundamental Grid components such

as the resources, data sets, workload traces, and information services.

Cloudsim - Cloudsim is implemented by programmatically extending the core functionalities exposed by

the Gridsim layer. It is also provided for modeling and simulation of virtualized Cloud-based data center

environments such as dedicated management interfaces for VMs, memory, storage, and bandwidth.

CloudSim layer manages the instantiation and execution of core entities (VMs, hosts, data centers,

application) during the simulation period. This layer is capable of simultaneously instantiating and

transparently managing a large scale Cloud framework comprising of thousands of system components.

Usercode - User Code that exposes configuration related functionalities for hosts (number of machines,

their specification and so on), applications (number of tasks and their requirements), VMs, number of

users and their application types, and broker scheduling policies.

Page 29: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

16

2.6 Summary

The various source of research related to cloud computing simulation and CloudSim simulator

toolkit application shows that flexibility of configuration of the cloud computing system. The various

approach techniques used help in generating a better version of project research in the future. A literature

review is done to ensure no identical research is done.

Page 30: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

17

CHAPTER 3

METHODOLOGY

3.1 Introduction

This chapter is to introduce a methodology proposed for this project and improve the idea by present

a framework, system model, and flowchart of the project. It starts with a case study that can be used in this

project. Then a discussion about the simulation technique used by using NetBeans to simulate the flow of

Cloudsim model to the real world.

Page 31: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

18

3.2 Framework of Resources Scheduling

A workload management system is where the process management for job scheduling is located in

cloud computing. In the workload management system, there are two sections that communicate to allocate

resources in the cloud computing system. The sections included are resources provisioner and resources

scheduler.

Figure 3.1: Resources scheduling framework in the Workload Management System

Firstly, resource provisionor allows the allocation of a cloud provider’s resources to a customer.

Then, resources scheduler is where it assigns the resources they have to jobs, tasks, or projects they need

to complete, and schedule start and end date for each task or project based on resource availability.

Page 32: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

19

3.3 Cloud Computing Scheduling Model

Figure 3.2 Cloud computing scheduling model

The cloud computing scheduling model is mainly built by the Client, Broker, Resources, Resources

Supporter, and Information Services. Figure 3.2 given scheduling model Broker is the middle interface

between the client and the resource provider. However, the broker will be discussed further since it plays

the main role in the process of the resource scheduling process. Firstly the client submits the task to the

broker, then broker searches for the resources in information service and then deploys the task to the

appropriate resources according to the algorithm provided to the broker.

Broker contains Job Control Agents, Scheduler advisor, Explorer, Trade, Manager, and

Deployment Agent. The process that exists in the Broker is a responsible resource scheduling process that

is going to be executed and allocated to the task given.

Page 33: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

20

Firstly, Job Control Agent that takes charge in monitor jobs that happen in software system such as

when the schedule is generated, how the job is creation happens, jobs status and communicate with client

as well with schedule advisor.

Next is schedule advisor that is used in order to determine resources, allocate available resources

which that can satisfy client’s demand in term of cost and deadline as well as job allocation. Another tool

is Cloud Explorer which communicates with cloud information services to search for resources and record

resources status information as well as identifies the list of authorized machines.

Trade Manager also available in Broker that determines the cost of resources access and makes an

attempt to communicate with resources at a low cost under the guidance of schedule advisor. Lastly, is the

Deployment Agent that uses scheduler instruction to activate the execution of tasks. It also updates the

status of execution and sending back to Job Control Agent at regular intervals.

Page 34: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

21

3.4 Design of Cloudsim

There are a few classes which important for working with CloudSim that will be explained further.

Figure 3.3: CloudSim Class Diagram

In order to stimulate cloud computing resources scheduling in Cloudsim, there a few classes that

need to be implemented into Eclipse where is java script of resources scheduling algorithm is being called

when the project is run.

Page 35: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

22

● CloudletScheduler

The policy of application execution defines in this abstract class. Cloudlet is executed concurrently

or sequentially depending upon the policies. CloudletSchedulerTimedShared and

CloudletSchedulerSpaceShared are the extended class which allow an application to execute

concurrently and sequentially respectively. CloudletSchedulerDynamicWorkload also derived

from CloudletTimeShared allows dynamic resources load generation.

● Cloudlet

The number of instructions to be executed, the amount of disk transfer to complete the task is

encapsulated by the Cloudlet. It also provides a workload generation model, identification of guest

virtual machine on which it’s running.

Both classes need to be initialized in order to implement resource scheduling in CloudSim. Thus,

this class will be used in CloudSim simulation which decides the CPU performance and task allocation

during the simulation.

Page 36: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

23

3.5 Cloudsim Model

Figure 3.4: Cloudsim Model Diagram

● Data centers: The resource provider, includes one or more hosts.

● Host: The physical machine that allocates one or more VMs.

● Virtual machine: Machines on which the cloudlet will be executed.

● Cloud Information Service (CIS): Responsible for registering all resources of data centers.

● Broker: When a broker has the DC characteristics, it will submit VMs to the specific host in the

specific DC and then allocate the cloudlets (tasks) to specific VMs. Finally, the broker will

destroy the free VMs after the execution of all cloudlets.

● Cloudlets: In Cloudsim, cloudlets are all tasks and applications that are executed on VMs.

Page 37: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

24

3.6 Scheduling Algorithms

3.6.1 First Come First Serve Algorithm

First Come, First Serve (FCFS) is one of the process scheduling algorithms that commonly used in

task scheduling of the operating systems. FCFS is a mechanism that executes a request in a queue and

processes it based on their arrival order. It handles the job execution process with the concept of the first-

come will be handled first and the next job will be executed once the previous job is complete.

The benefit of using FCFS is the scheduling able to provide efficiency. The concept of FCFS can

easily be applied since it is a simple scheduling algorithm and at the same time, it is an error-free scheduling

algorithm that helps in saves CPU resources.

The job processing request being handle in a non-preemptive mode which completes the scheduling

process without interruption.

Page 38: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

25

3.6.2 Flowchart of FCFS

Figure 3.5: Flowchart of the First-come-First-Serve algorithm

Page 39: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

26

3.6.3 Pseudocode of FCFS

1. Firstly, start the program.

2. Read the number of processes count in (int).

3. Read the burst time of all processes from the user.

4. Read the arrival time of each process for this scheduling.

5. Calculate the waiting time and turn-around time.

6. Display it coming the result of first come first serve Scheduling.

7. Calculate average waiting time and average total turn-around time and display it on screen.

8. Terminate the program.

Page 40: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

27

3.6.4 Highest Response Ratio Next (HRRN) Algorithm

The criteria for Highest Response Ratio Next (HRRN) is the Response Ratio (RR). The

calculation of the response ratio is stated in equation 3.1

Equation 3.1: Formula of Response Ratio

W = Waiting Time

S = Service Time or Burst Time

HRRN not only supports the shorter process, but it also limits the waiting time of the long

process.

HRRN works as FCFS but when there is a tie (more than one process waiting to get

scheduled) it calculates the RR of all the processes which are in the tie and selects the highest RR value.

Page 41: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

28

3.6.5 Flowchart of HRRN Algorithm

Figure 3.6: Flowchart of HRRN algorithm

Page 42: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

29

3.6.6 Pseudocode of HRRN Algorithm

1. First, loop the queue to find the highest ratio.

2. Calculate each ratio and compare it to the highest ratio.

3. If the response ratio is greater than the highest ratio then update.

4. If the element is at the start of the queue, dequeue it and set the list to its next element.

5. Go back to the start of the queue and find the element before the dequeued element.

6. Assign previous next to the dequeued process next.

7. Return the highest ratio element in the list.

8. Repeat once the running process has completed the job or is preempted.

Page 43: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

30

3.6.7 Round Robin (RR) Algorithm

Round Robin is an algorithm that is applied for process and network schedulers in the computing

system. The work-frame of Round Robin is where time allocation of job scheduling being assigned in equal

time partition and happens in a circular order.

As the characteristic of Round Robin is a simple algorithm scheduling that is easy to be

implemented and offers starvation free as well in the process of job scheduling in the operating system.

Round Robin scheduling handles each job in uniform portions and time allocation without priority assigned.

In order to achieve the goal of fair processor scheduling, Round Robin scheduling did employ time

sharing which means allocate a time slot for each job and allows interruption occurs if there is an

uncompleted job that had to reach its time quantum allocation. Then, the job is resumed in the next time

slot to the particular job queue that in a waiting line.

In best-effort packet switching and another statistical multiplexing, round-robin scheduling can be

used as an alternative to first-come-first-serve queuing. Round-robin scheduling results in max-min fairness

if the data packets are equally sized since the data flow that has waited the longest time is given scheduling

priority.

Page 44: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

31

3.6.8 Flowchart of Round Robin Algorithm

Figure 3.7: Flowchart of Roun Robin algorithm

Page 45: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

32

3.6.9 Pseudocode of Round Robin Algorithm

1. Program Start.

2. Declare a variable that required for the Round Robin scheduling algorithm.

3. Take the number of processes is required.

4. Take burst time for every process.

5. Take quantum value (time limit of the process).

6. Take arrival time for every process.

7. Taken data, Calculate the waiting time & turn-around time, and average turn-around time of the

process.

8. Print the result.

9. End of the program.

Page 46: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

33

3.6.10 Shortest Job First (SJF) Algorithm

Shortest Job First (SJF) is one of the scheduling algorithms involved in the project of cloud

computing simulation in Cloudsim. Basically, this algorithm works as its name as well which is it will make

execution time to be complete its job scheduled.

One of the characteristics of SJF is non-preemptive where there is no preempted of the task is

allowed until particular tasks had complete its CPU burst. Moreover, there is a role of the priority queue

when the ready queue takes actions based on the smallest CPU time.

There is a situation where FCFS scheduling is used in assigning priority when there is more than

one equal completion time. There are a few advantages that will benefit the user and CPU utilization which

is one of it affect the result in a minimum average of waiting time for each set of process.

Page 47: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

34

3.6.11 Flowchart of SJF

Figure 3.8: Flowchart of SJF Algorithm

Page 48: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

35

3.6.12 Pseudocode of SJF

1. Firstly, Start process

2. Declare array size is. A [10].

3. Take a number of elements to be inserted.

4. Select process which has the shortest burst time among all process will execute first.

5. If the process has the same burst time length then FCFS (First Come First Serve) scheduling

algorithm used.

6. Make an average waiting for the time length of the next process.

7. Start with the first process, selection as above and other processes are to be in the queue.

8. Calculates burst total number of times.

9. Display the related values.

10. Now Close / Stop process

Page 49: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

36

3.7 Software and Hardware

In this project, there are few software had been used throughout the process of documentation and

implementation. First is the Java Development Kit 1.8.0_91. Next, NetBeans JDK. Then, cloud computing

simulation, CloudSim 3.0.3 tool kit, Lastly, Windows 10 operating system. There is no usage of additional

hardware in this project.

Page 50: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

37

3.8 Summary

This chapter discusses the general architecture and resource scheduling in a cloud computing

environment. Then, it briefly explained how the FCFS, RR, SJF, and HRRN scheduling algorithm works

and what is the flowchart and pseudocode involved in both schedules. The algorithm will be implemented

in Cloudsim which uses JavaScript on NetBeans and the final expected result which is a graph can be

represented in the next chapter.

Page 51: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

38

CHAPTER 4

IMPLEMENTATION AND RESULT

This chapter will show future works on how to start with cloudsim and start running scheduling

algorithms and make changes to the scheduling programs.

Fundamental steps in running a cloudsim are by configuring cloudsim itself in NetBeans

application. This is required due there are various classes that will be used and cloudsim had provided a

bunch of source codes that will be used in the program in the future.

Page 52: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

39

4.1 Create Cloudsim Project Simulation Toolkit

Step 1

Open NetBeans application. In this project, NetBeans IDE 11.0 version is used for Cloudsim

simulation. Click on “File” at the toolbar and click “New Project”. This will result in the creation of the

java project program.

Figure 4.1: Interface of NetBeans application

Page 53: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

40

Step 2

Click “Java with Ant” categories and choose Java Application.

Figure 4.2: Create new project

Page 54: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

41

Step 3

Name the project “Cloudsimproject1” and untick “create main class”. It can prevent redundancy of

existing main class since Cloudsim folders need to be imported into NetBeans application

Figure 4.3: Enter the project file’s name

Page 55: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

42

Step 4

At this step, there are two files that come together in the project which is Source Packages and

Libraries. Then click on the Libraries file icon and right-click to add jar file.

Jar files consist of multiple source code that contains classes and cloudsim examples that will be helpful in

the project scheduling in cloudsim.

Figure 4.4: Import jars file of Cloudsim into NetBeans program

Page 56: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

43

Step 5

Open jar file in the folder of cloudsim and select all jar files to allow the export of source codes in

Cloudsim project simulation. This will result in multiple files that consist of class, example, and cloudsim

simulation in java language.

Figure 4.5: Select jars file of Cloudsim

Page 57: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

44

Step 6

Once the process of export Cloudsim folder into Java Cloudsim program had succeeded, we can

start with running on the existing example code from Cloudsim to observe the java file mechanism of

cloudsim.

Figure 4.6: Output with existing example code from Cloudsim

Page 58: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

45

4.2 Make changes in Scheduling algorithm and Resource Allocation algorithm

Task Scheduling in Cloudsim is one of the alternative operating system simulations before it can

be directly implemented into the computing system. The simulation can be configured in various conditions

and easily changes based on the programmer's preferences. There are a few steps that have to be configured

in the Cloudsim scheduler before it can successfully undergo Cloudsim simulation. The configuration of

job scheduling in Cloudsim toolkits takes place in two different java files.

Creating Scheduler is the first step that needs to be included in the process of scheduling

configuration in Cloudsim. Scheduler java file is import files that going to be called into the scheduler. The

import process needs to include every single java class that needs to be used in Scheduler.java.file.

Page 59: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

46

Figure 4.7: Import class Scheduler.java file

There are a few modifications that need to be changed from the example in Cloudsim. This to

ensure that all scheduling algorithm is assigned to similar case situations.

Go to “Cloudsim 3.0.3\examples\org\cloudbus\cloudsim\examples” Choose example6 of java file

in Cloudsim and named as Scheduler.

Page 60: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

47

In the Scheduler java file, the first changes that need to be done are changes

CloudletSchedulerTimeShared into CloudletSchedulerSpaceShared. The reason for changing the mode of

Cloudlet Scheduler is to ensure full utilization of Virtual Machine at a time. The VM will first execute one

cloudlet using its full capacity and after the execution of the first cloudlet, the second one will be executed

The next step is to define Virtual Machine (VM) and the Cloudlet parameter. This action will result

in a similar allocation of tasks on virtual machines during the job scheduling process.

VM Parameter

int vmid = 0;

int mips = 1000;

long size = 10000; //image size (MB)

int ram = 512; //vm memory (MB)

long bw = 1000;

int pesNumber = 1; //number of cpus

String vmm = "Xen"; //VMM name

Cloudlet Parameter

int id = 0;

int pesNumber=1;

long length = 1000;

long fileSize = 300;

long outputSize = 300;

UtilizationModel utilizationModel = new UtilizationModelFull();

Page 61: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

48

Another process is writing static method java language which means that main class is created to

run this Scheduler algorithm.

First step: Initialize the Cloudsim package.

It should be called before creating any entities. Then, initialize the Cloudsim library

Second step: Create Datacenters

The datacenter is the resource providers in Cloudsim. We need to list one of them to run

Cloudsim simulation.

Third step: Create Broker

Fourth step: Create VMs and Cloudlets and send them to broker

Fifth step: Start the simulation

Final step: Print results when the simulation is over

Page 62: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

49

Figure 4.8: Main class in Scheduler.java

Page 63: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

50

4.3 Make Changes of Scheduling Process in Cloudsim

Another file that will be used to successfully run the simulation is DatacenterBroker java.file.

Go to “cloudsim-3.0.3\sources\org\cloudbus\cloudsim\DatacenterBrokerjava.file” this is the java

program where the scheduling is been performed. DatacenterBroker represents a broker acting on behalf of

a user. It hides VM management, VM creation, submission of cloudlets to these VMs, and destruction of

VMs. There are 3 functions executed for each request/cloudlet in sequence order.

The first function involved is datacenter examination and VM creation in the datacenter where the

request is taken and is bee given to a datacenter to check whether it can be fulfilled or not and

“createVmsInDatacenter()” function is called.

protected void processResourceCharacteristics(SimEvent ev) {

DatacenterCharacteristics characteristics = (DatacenterCharacteristics) ev.getData();

getDatacenterCharacteristicsList().put(characteristics.getId(), characteristics);

if (getDatacenterCharacteristicsList().size() == getDatacenterIdsList().size()) {

setDatacenterRequestedIdsList(new ArrayList<Integer>());

createVmsInDatacenter(getDatacenterIdsList().get(0));

}

Page 64: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

51

The next function involves the action of datacenter check whether the request can be fulfilled or

not and if it can be fulfilled, “CloudSimTags” is set to a true function which says that request is fulfilled.

protected void createVmsInDatacenter(int datacenterId) {

// send as much vms as possible for this datacenter before trying the next one

int requestedVms = 0;

String datacenterName = CloudSim.getEntityName(datacenterId);

for (Vm vm : getVmList()) {

if (!getVmsToDatacentersMap().containsKey(vm.getId())) {

Log.printLine(CloudSim.clock() + ": " + getName() + ": Trying to Create VM #" + vm.getId()

+ " in " + datacenterName);

sendNow(datacenterId, CloudSimTags.VM_CREATE_ACK, vm);

requestedVms++;

}

}

getDatacenterRequestedIdsList().add(datacenterId);

setVmsRequested(requestedVms);

setVmsAcks(0);

}

Page 65: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

52

Another function that is called in DatacenterBroker is where check tag in the particular

DatacenterBroker. In this class, if the tag is true it is set to be fulfilled else it is been tried to be allocated to

a different datacenter.

protected void processVmCreate(SimEvent ev) {

int[] data = (int[]) ev.getData();

int datacenterId = data[0];

int vmId = data[1];

int result = data[2];

if (result == CloudSimTags.TRUE) {

getVmsToDatacentersMap().put(vmId, datacenterId);

getVmsCreatedList().add(VmList.getById(getVmList(), vmId));

Log.printLine(CloudSim.clock() + ": " + getName() + ": VM #" + vmId

+ " has been created in Datacenter #" + datacenterId + ", Host #"

+ VmList.getById(getVmsCreatedList(), vmId).getHost().getId());

} else {

Log.printLine(CloudSim.clock() + ": " + getName() + ": Creation of VM #" + vmId

+ " failed in Datacenter #" + datacenterId);

}

incrementVmsAcks();

// all the requested VMs have been created

Page 66: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

53

if (getVmsCreatedList().size() == getVmList().size() - getVmsDestroyed()) {

submitCloudlets();

} else {

// all the acks received, but some VMs were not created

if (getVmsRequested() == getVmsAcks()) {

// find id of the next datacenter that has not been tried

for (int nextDatacenterId : getDatacenterIdsList()) {

if (!getDatacenterRequestedIdsList().contains(nextDatacenterId)) {

createVmsInDatacenter(nextDatacenterId);

return;

}

}

// all datacenters already queried

if (getVmsCreatedList().size() > 0) { // if some vm were created

submitCloudlets();

} else { // no vms created. abort

Log.printLine(CloudSim.clock() + ": " + getName()

+ ": none of the required VMs could be created. Aborting");

finishExecution();

}

}

}

}

Page 67: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

54

Finally, the last function is the process of the request is been submitted with the datacenter id to

which it has been allocated.

protected void processCloudletReturn(SimEvent ev) {

Cloudlet cloudlet = (Cloudlet) ev.getData();

getCloudletReceivedList().add(cloudlet);

Log.printLine(CloudSim.clock() + ": " + getName() + ": Cloudlet " + cloudlet.getCloudletId()

+ " received");

cloudletsSubmitted--;

if (getCloudletList().size() == 0 && cloudletsSubmitted == 0) { // all cloudlets executed

Log.printLine(CloudSim.clock() + ": " + getName() + ": All Cloudlets executed. Finishing...");

clearDatacenters();

finishExecution();

} else { // some cloudlets haven't finished yet

if (getCloudletList().size() > 0 && cloudletsSubmitted == 0) {

// all the cloudlets sent finished. It means that some bount

// cloudlet is waiting its VM be created

clearDatacenters();

createVmsInDatacenter(0);

}

}

}

Page 68: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

55

There are two functions that are the important function which is the first and the third function

because in function 1 it has been decided which is the datacenter that has to be checked and function 3

decides the next datacenter will follow.

Page 69: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

56

4.4 Output of Scheduling algorithm in Cloudsim toolkit

Figure 4.9: Output of First Come First Serve task Scheduling

Page 70: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

57

Figure 4.10: Output of Highest Response Ratio Next task Scheduling

Page 71: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

58

Figure 4.11: Output of Round Robin task Scheduling

Page 72: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

59

Figure 4.12: Output of SJF task scheduling

Page 73: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

60

4.5 Result of Resources Scheduling algorithm of Response Time

Process FCFS Process HRRN Process RR Process SJF

0 0.1 9 0.1 0 0.1 3 0.1

1 1.1 4 1.11 1 4.1 0 1.19

2 3.1 0 2.15 2 8.1 5 2.4

3 6.1 2 3.21 3 12.1 2 4.05

4 10.1 3 5.02 4 16.1 1 5.92

5 15.1 8 6.92 5 20.1 9 7.98

6 21.1 1 8.92 6 24.1 7 10.07

7 28.1 6 11.11 7 28.1 6 12.33

8 36.1 5 13.56 8 32.1 8 14.91

9 45.1 7 16.09 9 36.1 4 17.52

Table 4.1: Response Time of Scheduling in Cloudsim

Table 4.1 above shows the response time process with CPU utilization by using four different job

scheduling algorithm approach in the Cloudsim toolkit simulation. The output of the project is being

recorded into table form to allow easier extraction of data gained.

Page 74: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

61

FCFS HRRN RR SJF

16.6 6.819 18.1 7.647

Table 4.2: Average Response Time in Cloudsim

Table 4.2 shows the total calculation of average response time for all job scheduling algorithm.

By using the formula of finding the mean value, the average time of response time can be calculated as

well. HRRN algorithms hold the smallest value of average response time for Cloudsim cloud computing

simulation.

Page 75: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

62

4.6 Graph Analysis of Resources Scheduling Algorithm in Cloudsim

Figure 4.11: Analysis of Resources Scheduling in Cloudsim

The graph above shows four resources scheduling algorithm actions towards a response time of the

CPU execution process.

In this analysis, we can conclude that HRRN algorithms did works as resources scheduling

algorithm that results in the shortest response time for CPU execution and computes the smallest average

response time on process execution

First Come First Serve scheduling algorithm takes more time in process execution as it applied the

concept of first in first out rules whereas it followed by Round Robin and Shortest Job First respectively.

Page 76: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

63

Figure 4.12: Average Response Time in Resources Scheduling of Cloudsim

The graph above computes the average response time in the resource scheduling of Cloudsim.

Average response time is obtained through the calculation of total response time with a number of

processes. HRRN algorithm has the lowest average response time followed by the SJF scheduling

algorithm. Both scheduling algorithm assigns effective rules of process execution.

Page 77: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

64

CHAPTER 5

CONCLUSION

5.1 Introduction

In this chapter, the conclusion, limitations of the project, and future work are discussed in order to

improve the system through time.

5.2 Project Contribution

Resources Scheduling in Cloud Computing Environment is a scheme that allocates few resources

scheduling simulations that will help to calculate response time. Thus, this project can contribute to how to

improve the computing system in optimal conditions. This project also gives a better understanding of how

resource scheduling works which it can expose on how the operating system of computers handles tasks.

Besides that, using a cloud computing environment approach helps in giving a better version of cloud

services that are available in current usage. This is because of the limited sources and exposure that

constraints the cloud computing environment from being widely used.

Page 78: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

65

5.3 Result Discussion

Generally, this project has been carried out and follows the objective of the project as stated in

Chapter 1. By using different scheduling algorithms in operating system configurations, this helps in terms

of creating a better CPU utilization operation in cloud computing systems.

The idea of configuring scheduling algorithms in simulation mode is to get the idea of how cloud

computing operating systems operate on different scales and multiple case configurations. Moreover, this

will give a brief information regarding cloud computing that is involved in this project which consists of

FCFS, RR, SJF, and HRRN algorithm.

Thus, this research did contribute to future references for academic purpose and understanding the

process ongoing in the operating system before the implementation of scheduling algorithms is done.

Page 79: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

66

5.4 Problems and Limitations

There are a few constraints and limitations that occur throughout the process development of this

project. The problems in limitations in conducting the project is:

This approach does not respond in similar time response and efficiency at a real-time condition of

the computing system since in the Cloudsim toolkit we had to configure the task regarding the parameter

used.

Next, this project needs to be updated in certain parameter locations manually in order to allow

scheduling algorithms to be run in other case simulations. As the structure, if the Cloudsim is in complex

form, it needs more time in the configuration of task scheduling.

Lastly, this project is not user friendly as the project consists of multiple sets of java files and no

interface had been developed yet which can help them in configure the project in an easier way.

Page 80: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

67

5.5 Future Works

There are another suggestion and improvement that can be applied in future work project regarding

this cloud computing simulation toolkit of Cloudsim.

Provide user manual and a brief explanation that related to the configuration of resources

scheduling as there are limited sources that available to get started with resources scheduling simulation in

Cloudsim.

Infuse multiple resources scheduling algorithms into a single package of Cloudsim resources

scheduling file to minimize the time consumed in understanding the whole operation of Cloudsim itself.

5.6 Conclusion

Task Scheduling in Cloud Computing Environment is a project that simulates the resources

scheduling process in a version of the cloud computing environment. The selection of resources scheduling

algorithm is based on the commonly used algorithm such as FCFS, RR, and SJF as well as unfamiliar

resources scheduling that offer better CPU utilization in terms of shortening the response time of the Cloud

computing system. The analysis of FCFS, RR, SJF, and HRRN resources algorithms in this project using

response time as an analysis parameter is concluded in graph form. This project will provide a brief

overview of Cloudsim CPU allocation that aims to assist Cloud providers and users to make intelligent

decisions regarding Cloud computing model implementation.

Page 81: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

68

Reference

[1] M. Armbrust, A. Fox, R. Griffith, A. Joseph, R. Katz, A. Konwinski, G. Lee, D. Patterson, A.

Rabkin, I. Stoica, M. Zaharia. Above the Clouds: A Berkeley View of Cloud computing. Technical

Report No. UCB/EECS-2009-28, University of California at Berkley, USA, Feb. 10, 2009

[2] Gunho Lee (2012), Resources Allocation and Scheduling in Heterogeneous Cloud Environment

[3] Rakesh Kumar Sanodiya, Dr.Varsha Sharma (2014) Comparison of Highest Response Ratio Next

Algorithm with First Come First Served in Cloud Computing, International Journal of Applied

Information Systems (IJAIS) - ISSN: 2249-0868 Foundation of Computer Science FCS, New York, USA

Volume 5 - No. 9, July 2013

[4] Sajida Fayyaz, Hafiz Ali Hamza, Saria Moin U Din and Ehatsham Riaz(2017) Comparative

Analysis of Basic CPU Scheduling Algorithms, International Journal of Multidisciplinary Sciences and

Engineering, Vol, 8, No. 2, March 2017

[5] Comparison of Scheduling Algorithms. (n.d.). Retrieved from

https://www.studytonight.com/operating-system/comparision-scheduling-algorithms.

[6] K. A. Nuaimi, N, Mohamed, M. A. Nuaimi, and J. Al-Jaroodi, “A survey of load balancing in

cloud computing: Challenges and algorithms,” in Network Cloud Computing and intelligent System

(CCIS), 2012 IEEE 2nd International Conference on, vol. 1, pp. 392-396, IEEE, 2012.

[7] Mohit Tomar (2017), Comparative analysis of load balancing algorithms in cloud computing,

ProQuest Dissertations Publishing, 2017. 10262288

[8] Wayne A. Pauley Jr. (2012), Toward Risk Assessment as a Service in Cloud Environments

[9] CloudSim: A toolkit for modeling and simulation of cloud computing environments and

evaluation of resource provisioning algorithms by Rodrigo N Calheiros, Rajiv Ranjan, Anton Beloglazov,

CŽesar A F De Rose and Rajkumar Buy

[10] Anton Beloglazov_ and Rajkumar Buyya, Optimal Online Deterministic Algorithms and

Adaptive Heuristics for Energy and Performance Efficient Dynamic Consolidation of Virtual Machines in

Cloud Data Centers, CONCURRENCY AND COMPUTATION: PRACTICE AND EXPERIENCE

Concurrency Computat.: Pract. Exper. 2012; 24:1397–1420

Page 82: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

69

APPENDIX

GANTT CHART FYP 1:

Page 83: TASK SCHEDULING USING HIGHEST RESPONSE RATIO NEXT … · 2020. 7. 16. · AHMAD AQIL IZZUDDIN BIN MOHD ZULKURNIN Bachelor of Computer Science (Computer Network Security) Faculty of

70

GANTT CHART FYP 2: