Professional Documents
Culture Documents
= pocs
o
P1
=
( +8) - 8
-
6
- = . scons
o
Rcst
= ( -) _
+8
-
6
] - 8 = . scons
o
totuI
= o
P1
+ o
Rcst
= . +. = . scons
Now well take 6 more samples of data to be queried by the server i.e. 7MB, 8MB, 9MB,
10MB and 11MB. The link bandwidth and payload would remain the same.
Amount of data (MB) Time (Seconds)
6MB 27.03
7MB 31.53
8MB 36.04
9MB 40.55
10MB 45.05
11MB 49.06
Table 2 Delays for a Single Virtual Machine
In the table above, the total delay is calculated for a single virtual machine for six sample
amount of data having link bandwidth of 2 Mb and. Payload and header size would be 256
bytes and 8 bytes.
Resource Optimization in Mobile Cloud Environments
37
Graph 1:
The graph above shows the delays regarding the packet size to be sent to the server.
Vertical axis shows the time units in seconds and horizontal axis shows amount of data in
MB. The graph clearly explains that by increasing the amount of data results in the increase
in delays. For 6MB the total delay is 27.03 seconds and after that when amount of data is
increased delay is increased and at 11MB it has reached to almost 50 seconds.
4.4. Challenges and Issues in the current design
In the above scenario explained in Chapter 3 we had only one single virtual machine running
that handles the requests from the android client. The major challenges that could be faced
in that design are
1. Scalability
2. Availability
3. Reliability
0
10
20
30
40
50
60
6MB 7MB 8MB 9MB 10MB 11MB
Time (Seconds)
Time (Seconds)
Resource Optimization in Mobile Cloud Environments
38
4.4.1. Scalability
The major challenge that we would face in that design is scalability. Scalability refers to how
well a hardware or software system can adapt to increased demands. For example, a
scalable network system would be one that can start with just a few nodes but can easily
expand to thousands of nodes. Scalability can be a very important feature because it means
that we can invest in a system with confidence we won't outgrow it. In our current design
we describe it with only one single user but suppose when more and more clients join the
cloud and the number counts to 100s or 1000s clients that send the request to the server.
The following question will arise:
Would that server be able to handle that amount request?
Would that system is capable to increase total throughput under an increased load
when resources (typically hardware) are added?
The answer is No because when more and more clients are added then at one stage the
servers capacity of handling the requests would slow down and hence can increase the
chances of server failure.
4.4.2. Availability
The next issue is availability. When we are running a single server then we should make sure
that it should be available at all times for the nodes to send back the response and handling
the queries. Suppose if our server gets fail or it has got some problem in its hardware which
has stopped the server to run then how we are going to cope with this situation? Then
solution is to run a backup server but still there would be scalability issues.
4.4.3. Reliability
Reliability refers to as ability of a component/system to function correctly over a specied
period of time, mostly under pre-dened conditions. Fault tolerance is dened as the ability
of the system to continue operation in the event of a failure. Fault tolerance means that a
computer system or component is designed such that, in case a component fails, a backup
component or backup procedure can immediately take its place with no loss of
functionality. Reliability can be improved through fault tolerance
[21]
. Reliability can be
achieved by redundancy of the software or hardware components that run as the backup if
any system functionality fails.
Resource Optimization in Mobile Cloud Environments
39
4.5. Proposed Work
4.5.1. Load Balancing based on 5 Virtual Machines
We discussed our issues and challenges in the previous topic now we are going to find the
possible solutions. We added five Virtual Machines with different capacities in the design
that will run parallel and handle the clients requests and process them based on their
capacities i.e. number of processors. Particle Swarm optimization technique is being used in
this case.
4.5.2. Handling Scalability
Suppose five virtual machines are VM1, VM2, VM3, VM4, and VM5. The processors assigned
to each virtual machine and the initial position of virtual machine is shown in the table
below
Virtual Machine Position Number of Processors
VM1 1 2
VM2 2 4
VM3 3 6
VM4 4 8
VM5 5 10
Table 3: Number of Processors assigned to each virtual machine
oo br o rocssors = + + +8 + = 3
oo br o ro Hocns =
Now suppose the client request to process 1000 records from database.
Solution 1
One solution could be that we divide the task equally to all virtual machines and they will
process the data for the client i.e. 1000/5 = 200 records per virtual machine but that
scenario is not the best solution because the virtual machine which has the less capacity
would have to process more than its original capacity thus will cause delay in the processing.
So this solution would not be considered as an optimize solution. To overcome this situation
we would consider the second solution explained below in which parallel running virtual
machines will process the clients tasks based on their capacities.
Resource Optimization in Mobile Cloud Environments
40
Solution 2
The other one we can do is that the virtual machines will process the clients request based
on their capacity. We calculate the capacity of each virtual machine. To find the capacity in
percentage well use the formula.
C|ty =
N. e eh
tt ue e
- 1 (1)
So for VM1:
opoc
vM1
=
- = %
For VM2:
opoc
vM2
=
- = %
For VM3:
opoc
vM3
=
- = %
For VM4:
opoc
vM4
=
8
- = %
For VM5:
opoc
vM5
=
- = %
From the above percentage for each virtual machine capacity it clearly states that virtual
machine VM1 will process 6% of total task, VM2 will process 12%, VM3 will process 20%,
VM4 will process 27% and VM5 will process 34% of the total task.
Resource Optimization in Mobile Cloud Environments
41
Virtual Machine Position Number of Processors Capacity
VM5 1 10 34%
VM4 2 8 27%
VM3 3 6 20%
VM2 4 4 13%
VM1 5 2 6%
Table 4: Position changed based on Capacity
In the table above we can see the capacity of each virtual machine according to the number
of processors assigned to them. Virtual machine VM5 has changed its position to position 1
because it is counted as best above all the virtual machines. It is sorted in descending order
Suppose if any virtual machine is modified i.e. if we increase the processors in VM3 to 15
then after VM3 would come at the top and.
Graph 2: Capacity of each virtual machine
The graph above explains the capacity of each virtual machine separately. VM5 has the
highest capacity to process the clients tasks.
0%
5%
10%
15%
20%
25%
30%
35%
40%
VM5 VM4 VM3 VM2 VM1
Capacity of Each VM
Capacity of Each VM
Resource Optimization in Mobile Cloud Environments
42
4.6. Experimental Work
Well use an example and see how the clients tasks are being processed by 5 virtual
machines running parallel in the cloud by using the solution 2 explained above.
Figure 13 Clients connected to the cloud
The figure above explains how different clients are connected with the cloud and using the
servers (Virtual Machine) resources in that cloud. All Server are connected to one database
and processing the clients tasks in parallel based on their capacities
Suppose a mobile client wants to get 1000 records from a huge database. The formula to
calculate the task processing for each virtual machine would be
t t e eed =
|ty-tt ut dt
1
(2)
Resource Optimization in Mobile Cloud Environments
43
Virtual Machine Subdivided Task (records)
VM1 60 records
VM2 130 records
VM3 200 records
VM4 270 records
VM5 340 records
Table 5
Table above are the records calculated to be processed by each virtual machine. We divided
this task into five subdivided tasks as explained in the figure below and each sub divided
task would be assigned to the virtual machine that matches its capacity
Figure 14 Tasks Assigned to each virtual machine
Resource Optimization in Mobile Cloud Environments
44
4.6.1. Applying PSO Algorithm
One of the key issues in designing a successful PSO algorithm is the representation step
which aims at finding an appropriate mapping between problem solution and PSO particle
[25]
. We have 5 tasks assigned to 5 virtual machines having different no of processors. Well
use Novel Bases optimization technique
[24]
.
Particles Positions:
In this method solutions are encodes as m x n which is called position matrix where m
denotes the number of virtual machines at the time of scheduling and n is the number of
tasks. The position matrix of each particle has two properties:
All the elements of the matrices have either the value of 0 or 1. In other words, if X
k
is the position matrix of kth particles, then:
(|, ) e {, 1] v |, , | e {1, 2, 3.. . ] & e {,,.. n] (3)
In each column of these matrices only one element is 1 and others are 0.
In position matrix each column represents a task allocation and each row represents
allocated tasks in a virtual machine. In each column it is determined that a task should be
performed by which virtual machine.
Task 1 Task 2 Task 3 Task 4 Task 5
VM1 1 0 0 0 0
VM2 0 1 0 0 0
VM3 0 0 1 0 0
VM4 0 0 0 1 0
VM5 0 0 0 0 1
Table 6 Position Matrix
According to our scenario we can see task 1 is performed by VM1, and it will not perform
others tasks. Similar is the case with other virtual machines as table above clearly explains
which task is performed by which virtual machine if it is 1 then the virtual machine will
execute that task and if it is 0 then that task would not be executed on that virtual machine.
Resource Optimization in Mobile Cloud Environments
45
Particles Velocity:
To find the velocity of the particle lets consider the following symbols that represent the
properties of the particles.
X
i
= Current Position of the particle.
V
i
= Current Velocity of the particle.
P
best
is the personal best position of the particle.
G
best
is the global best position of the particle.
t is the current iteration.
r1, r2 are randomly generated for every velocity update and 0 r1, r2 1. They
should both be different each iteration.
c1, c2 are user defined values are acceleration coefficients where 0 c1, c2 2.
Their value depends on the problem to be optimized.
w is the inertia weight
Particle velocity is considered as a m x n matrix in which elements are in range of
[-V
max
, V
max
]. If V
k
is the velocity matrix of kth particle,
(|, ) e |-
x
,
x
] v (|, ), | e {1, 2, 3.], e {1, 2, 3.] ()
Updating Particles Velocity:
Equation 5 below is used for updating particles velocity and Equation 10 is used for updating
position matrix for each particle.
k
(t+1)
(, ) = .
k
t
(, ) +c
1
. r
1
(bs
k
t
(, ) -X
k
t
(, ))
+ c
2
. r
2
(bs
k
t
(, ) -X
k
t
(, )) ()
Resource Optimization in Mobile Cloud Environments
46
X
k
(t+1)
(, ) =
k
(t+1)
(, ) = o
k
(t+1)
(, ) v e {,,.] (.)
X
k
(t+1)
(, ) = or s (.)
In the Equation 5 above
k
t
(, ) represents the element in ith row and jth column of kth
velocity matrix in iteration t and X
k
t
(, ) represents the element in ith row and jth column
of kth position matrix in iteration t. Equations 6.1 and 6.2 shows that the position matrix
value would be 1 if the velocity matrix has the maximum value in its corresponding column
otherwise it would be 0.
Fitness Value Evaluation:
According to
[24]
makespan and flowtime are used to evaluate the performance of scheduler
simultaneously. Because makespan and flowtime values are in incomparable ranges and the
flowtime has a higher magnitude order over the makespan, the value of mean flowtime,
flowtime / m, is used to evaluate flowtime where m is the number of available nodes. The
Fitness value of each solution can be estimated using (7).
nss o =
z. ospon +( -z). on
]Iowtmc
()
In the equation 7 above z is used to regulate the effectiveness of parameters used in this
equation. The greater the, more attention is paid by the scheduler in minimizing makespan
and vice versa. The smaller makespan and flowtime in (7), the greater fitness value, and
hence a better solution it is regarded
[24]
.
Resource Optimization in Mobile Cloud Environments
47
Pseudo Code:
Now from the observations and equations above generated pseudo code of PSO algorithm
is described below
For each particle
Initialize particles with m x n dimensions
Do
For each particle i =1, 2, 3..... P
//Calculate Fitness Value
If f(X
i
) > f(pbest
i
)
pbest
i
= X
i
;
End
//Choose the particle with the best fitness value as global best
If f(pbest
i
) > f(gbest
i
)
gbest
i
= pbest
i
;
End
End
//Calculate Particle Velocity and update its position
For each particle i =1, 2, 3..... P
Update the velocity matrix using (5)
Update the position matrix using (6)
End
While maximum iterations or until stopping condition is true;
The pseudo code above shows the structure of the algorithm. We can follow this pseudo
code to develop PSO application.
Resource Optimization in Mobile Cloud Environments
48
At the initial steps first we have to generate the swarm of particles that would have m x n
dimensions where m shows the number of virtual machines and n shows the number of
tasks. Then calculate the fitness values which would be based on markspan and flowtime by
using equation 7 for each particle in the swarm and choose the best local best i.e. pbest
virtual machine. Then the best particle judged is set as global best. If in the iteration the
particle assigned locally the best i.e pbest has higher fitness value than the global best
(gbest) then the pbest is assigned to gbest and that would be the global best particle. After
it is done particle swarm algorithm updates the velocity matrix and the position matrix until
the loop iterates.
Resource Optimization in Mobile Cloud Environments
49
Chapter 5
5. Conclusion
Resource Optimization in Mobile Cloud Environments
50
5.1. Conclusion
In this project we conclude that sharing the resources among other virtual machines in a
mobile could result in fast processing of the requests sent by the clients. Furthermore the
issues we faced in topic 4.4 could be reduced down and ensures high scalability, availability
and reliability of virtual machines in a cloud by dividing the task among virtual server
running in the cloud. If there are more virtual servers in a cloud then the chances of failure
becomes less and high availability could be achieved. The cloud would be fast and secure.
For example by using the topology above if any virtual machine in the cloud fails then the
task would be divided into the other virtual machines that are running.
If we compare a cloud with five virtual machines and a cloud with single virtual machine
then the cloud with 5 virtual machines will definitely perform better because all the
resources of 5 virtual machines are shared among themselves and the chances of failure are
reduced and the cloud would be more scalable. Furthermore if we apply Particle Swarm
Optimization technique to among the server then it would become more efficient and
optimized because every job would be scheduled according to the servers capacity and
time the server achieved to process the jobs i.e. makespan and flowtime.
5.2. Future Work
In this dissertation we optimized our mobile cloud based on server capacity and time span.
But we can consider more techniques and algorithms like bandwidth optimization, server
storage, network latency etc to enhance the performance of our cloud. We discussed only
Particle Swarm Algorithm and we optimized the cloud based on its capacity i.e. no of
processors to handle the requests. Mobile cloud is a vast concept and load balancing plays
very important to make every type of cloud efficient. However in case of mobile cloud
computing two more issues are need to be considered that is Bandwidth Capacity and
Network Latency. More and more development is being done in this field. But although
network is unpredictable so we have to consider many other parameters as well to make
the network optimized and efficient.
Resource Optimization in Mobile Cloud Environments
51
References
[1] Design of Intelligence Mobile Cloud Service Platform Based Context Aware
By Hyokyung Chang and Euiin Choi
[2] Step BY Step Ubuntu 9.04 (Jaunty) LAMP Server Setup
By Ubuntugeek.com
[3] Installing Android SDK
By developer.android.com
[4] JSON Pros and Cons
By Alexander Ananieve 2007
[5] Call SOAP Web services with Ajax, Part 1: Build the Web services client
By James Snell 2005
[6] The Management of Security in Cloud Computing
By Ramgovind S, Eloff MM, Smith E
[7] A Platform Computing Whitepaper, Enterprise Cloud Computing: Transforming
IT, By Platform Computing, March 2010.
[8] The NIST Definition of Cloud Computing (DRAFT)
By Peter Mell, Timothy Grance January 2011
[9] Understanding the Layers within Cloud Computing
By The Silicon Whisperer November 2009
[10] Grid and Cloud Computing
By Katarina Stanoevska-Slabeva, Thomas Wozniak, Santi Ristol 2009
[11] Cloud Computing System and Its Layers
By Sharathr
[12] Web service Suitability Assessment for Cloud Computing
By M.S. Nanda Kishore et al
[13] Security Issues in Cloud Computing
By Pardeep Sharma, Sandeep K.
[14] Mark Walsh. Gartner: Mobile To Outpace Desktop Web
By 2013. Online Media Daily, January 13, 2010
[15] Mobile Cloud Computing
By Dijiang Huang Arizona State University, Arizona, USA
Resource Optimization in Mobile Cloud Environments
52
[16] Mobile, cloud computing to dominate software apps, IT deliveries in next 5 yrs,
says survey
By Priyanka Banarjee October 11 2010
[17] The Mobile Cloud: Why its so important
By Olafur Ingthorsson on May 16, 2011
[18] Overcoming mobile cloud computing challenges with distributed apps
By Bryan Betts July 2011
[19] Why Cloud Computing is the Future of Mobile
By Sarah Perez August 2009
[20] A Particle Swarm Optimization-based Heuristic for Scheduling Workflow
Applications in Cloud Computing Environments
By Suraj Pandey, LinlinWu, Siddeswara Mayura Guru, Rajkumar Buyya
[21] Hardware Reliability
By Irene Eusgeld, Bernhard Fechner, Felix Salfner, Max Walter, Philipp Limbourg and Lijun
Zhang
[22] Validity of the single processor approach to achieving large scale computing
capabilities
By Gene M Amdahl, IBM Sunnyvale California
[23] Characterizing Network Processing Delay
By Ramaswamy, Ning Weng and Tilman Wolf
[24] A Novel Particle Swarm Optimization Approach for Grid Job Scheduling
By Hesam Izakian, Behrouz Tork Ladani, Kamran Zamanifar, Ajith Abraham
[25]. Green Cloud on the Horizon
By Mufajjul Ali
[25] Non Dominated Particle Swarm Optimization For Scheduling Independent Tasks
On Heterogeneous Distributed Environments
By G. Subashini, M.C. Bhuvaneswari
[26] Scheduling Jobs on Computational Grids Using Fuzzy Particle Swarm Algorithm
By Ajith Abraham1,3, Hongbo Liu2, Weishi Zhang3, and Tae-Gyu Chang1
Resource Optimization in Mobile Cloud Environments
53
[27] Black Box Optimization Benchmark (BBOB) applied to classical optimization
algorithms: PSO, DE-PSO and CMA.
By Maarten Belmans, Hogeschool Gent, Tim Desmet, Hogeschool Gent 2010
[28]Context Model Based on Ontology in Mobile Cloud Computing
By Changbok Jang and Euiin Choi