code and process migration - iit-computer scienceiraicu/teaching/cs550-s11/lecture12.pdf · –ship...

19

Upload: vulien

Post on 06-Sep-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at
Page 2: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Code and process migration

– Motivation

– How does migration occur?

– Resource migration

• Distributed scheduling

CS550: Advanced Operating Systems 2

Page 3: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Key reasons: performance and flexibility

• Process migration (aka strong mobility)

– Improved system-wide performance –

better utilization of system-wide resources

• Code migration (aka weak mobility)

– Shipment of server code to client

– Ship parts of client application to server

instead of data from server to client

– Improve parallelism

CS550: Advanced Operating Systems 3

Page 4: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Performance

– The overall system performance can be

improved if processes are moved from

heavily-loaded to lightly-loaded machines

– Exploit parallelism, e.g., searching for

information in the web through the

development of mobile agent, that moves

from site to site

– fault tolerance, e.g., moving from failure-

prone to failure-free machines

CS550: Advanced Operating Systems 4

Page 5: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Flexibility

– Dynamic configuration of distributed

system

– Clients don’t need preinstalled software –

download on demand

CS550: Advanced Operating Systems 5

Page 6: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Process = code seg + resource seg + execution seg

• Weak versus strong mobility

• Sender-initiated versus receiver-initiated

– Sender-initiated (code is with sender)

• Client sending a query to database server

• Client should be pre-registered

– Receiver-initiated

• Java applets

• Receiver can be anonymous

CS550: Advanced Operating Systems 6

Page 7: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Challenge: multiple processing nodes=> scheduling not only is performed locally on each node but also globally across the system

• Distributed scheduling (aka load balancing): potentially useful for performance improvement or system utilization

• An Example: Work Stealing

CS550: Advanced Operating Systems 12

Page 8: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• The measure of load

– Must be easy to measure

– Must reflect performance improvement

• Types of policies

– Static vs. Dynamic vs. Adaptive

• Types of task transfers

– Preemptive vs. non-preemptive

• Major components

• Three algorithms CS550: Advanced Operating Systems 13

Page 9: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Transfer policy: when to transfer a task? – Threshold-based policies are common and easy

• Selection policy: which task to transfer? – An easy approach

• Location policy: where to transfer the task? – Polling, random, nearest neighbor

• Information policy: when and from where? – Demand driven

– Time-driven

– State-change-driven

CS550: Advanced Operating Systems 16

Page 10: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Sender-initiated:

– distribution initiated by an overloaded node.

• Receiver-initiated:

– Distribution initiated by lightly loaded nodes.

• Symmetric:

– Initiated by both senders and receivers.

CS550: Advanced Operating Systems 17

Page 11: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Transfer policy: use threshold

• Selection policy: newly arrived task

• Location policy: three variations – Random:

– Threshold:

– Shortest:

CS550: Advanced Operating Systems 18

Page 12: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Information Policy: demand-driven.

• Stability: can become unstable at high

loads, why?

CS550: Advanced Operating Systems 19

Page 13: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Transfer policy: If departing task causes

load < T, find a task from elsewhere

• Selection policy: newly arrived or partially

executed task

• Location policy:

– Threshold:

– Longest/heaviest: CS550: Advanced Operating Systems 20

Page 14: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Information policy: demand-driven.

• Stability: Not unstable since lightly loaded

nodes initiate the algorithm

• Drawbacks:

– ?

CS550: Advanced Operating Systems 21

Page 15: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Nodes act as both senders and receivers: combine

previous two policies without change

– Use average load as threshold

• Improved symmetric policy: exploit polling information

– Two thresholds: LT, UT, LT <= UT

– Maintain sender, receiver and OK nodes using polling info

– Sender: poll first node on receiver list …

– Receiver: poll first node on sender list …

CS550: Advanced Operating Systems 22

Page 16: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• If a system never gets highly loaded,

which one is better?

• In case of high loads, which one is

better?

• In case of widely fluctuating loads,

which one is better?

CS550: Advanced Operating Systems 23

Page 17: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Discussion

CS550: Advanced Operating Systems 24

Page 18: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

• Code and process migration

– Motivation

– How does migration occur?

– Resource migration

• Distributed scheduling

– Sender-initiated

– Receiver-initiated

– Symmetric

• Readings:

– Chpt 3 of AST

CS550: Advanced Operating Systems 29

Page 19: Code and process migration - IIT-Computer Scienceiraicu/teaching/CS550-S11/lecture12.pdf · –Ship parts of client application to server ... • Stability: can become unstable at

CS550: Advanced Operating Systems 30