Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.

Slides:



Advertisements
Similar presentations
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Distributed Scheduling.
Advertisements

CS-495 Distributed Systems Fabián E. Bustamante, Winter 2004 Processes Threads & OS Threads in distributed systems Object servers Code migration Software.
Ch 11 Distributed Scheduling –Resource management component of a system which moves jobs around the processors to balance load and maximize overall performance.
Processes: Code Migration Chapter 3 Will Cameron CSC 8530 Dr. Schragger.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed Scheduling.
1 Scheduling and Migration Lê Công Nguyên Trần Phúc Nguyên Phan Tiên Khôi.
Serverless Network File Systems. Network File Systems Allow sharing among independent file systems in a transparent manner Mounting a remote directory.
Describe the concept of lightweight process (LWP) and the advantages to using LWPs Lightweight process (LWP) lies in a hybrid form of user-level & kernel-level.
Threads Clients Servers Code Migration Software Agents Summary
EECS122 - UCB 1 CS 194: Distributed Systems Processes, Threads, Code Migration Computer Science Division Department of Electrical Engineering and Computer.
Computer Science Lecture 8, page 1 CS677: Distributed OS Code and Process Migration Motivation How does migration occur? Resource migration Agent-based.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Computer Science Lecture 7, page 1 CS677: Distributed OS Multiprocessor Scheduling Will consider only shared memory multiprocessor Salient features: –One.
CS 603 Threads, Processes, and Agents March 18, 2002.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
AgentOS: The Agent-based Distributed Operating System for Mobile Networks Salimol Thomas Department of Computer Science Illinois Institute of Technology,
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
PRASHANTHI NARAYAN NETTEM.
Chapter 3  Processes 1 Processes Chapter 3 Chapter 3  Processes 2 Introduction  A process is a program in execution  For OS important issues are.
Give an example to show the advantages to using multithreaded Clients See page 142 of the core book (Tanebaum 2002).
1 Distributed Systems: Distributed Process Management – Process Migration.
CSE 490dp Check-pointing and Migration Robert Grimm.
DISTRIBUTED PROCESS IMPLEMENTAION BHAVIN KANSARA.
Processes.
Summary :- Distributed Process Scheduling Prepared BY:- JAYA KALIDINDI.
Distributed Process Implementation Hima Mandava. OUTLINE Logical Model Of Local And Remote Processes Application scenarios Remote Service Remote Execution.
Distributed Process Implementation
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
Load distribution in distributed systems
Distributed Scheduling
Computer Engineering Department Distributed Systems Course
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
1 Processes Chapter 3. 2 Processes  Communication takes place between processes. But, what ’ s a process?  “ A program in execution ”  Traditional.
Kyung Hee University 1/57 Communication Chapter 3.
Computer Science Lecture 8, page 1 CS677: Distributed OS Last Class Threads –User-level, kernel-level, LWPs Multiprocessor Scheduling –Cache affinity –Preemption.
Processes Chapter 3. Table of Contents Multithreading Clients and Servers Code Migration Software Agents (special topic)
Transparent Process Migration: Design Alternatives and the Sprite Implementation Fred Douglis and John Ousterhout.
Processes Chapter 3. Thread Usage in Nondistributed Systems Context switching as the result of IPC.
Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
1 Process migration n why migrate processes n main concepts n PM design objectives n design issues n freezing and restarting a process n address space.
Processes Chapter 3. Processes  OS provides concurrency transparency of multiple processes (sharing CPU, memory)  High price  Process creation  Context.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Processes. Processes and threads Process forms a building block in distributed systems Processes granularity is not sufficient for distributed systems.
Processes Introduction to Operating Systems: Module 3.
Code Migration Russell T. Potee, III. Overview Why Code Migration? Code Migration Models Migration and Handling Resources Heterogeneous Systems Migration.
Distributed Systems Principles and Paradigms Chapter 03 Processes 00 – 1.
Page 1 Process Migration & Allocation Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this.
Computer Science Lecture 7, page 1 CS677: Distributed OS Multiprocessor Scheduling Will consider only shared memory multiprocessor Salient features: –One.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Processes Chapter 3. Processes Process: Program in execution. In DSs, more concepts come into consideration, eg. Multi-treading, process migration, code.
1 Reasons for Migrating Code The principle of dynamically configuring a client to communicate to a server. The client first fetches the necessary software,
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Distributed (Operating) Systems -Virtualization- -Server Design Issues- -Process and Code Migration- Computer Engineering Department Distributed Systems.
1 Chapter 3 Processes Dowon Cho (RTMM Lab) & Jongwon Lee (SE Lab)
09/13/04 CDA 6506 Network Architecture and Client/Server Computing Peer-to-Peer Computing and Content Distribution Networks by Zornitza Genova Prodanoff.
Processes, Threads and Virtualization Chapter The role of processes in distributed systems.
Distributed Scheduling Motivations: reduce response time of program execution through load balancing Goal: enable transparent execution of programs on.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
C HAPTER 5.4 DISTRIBUTED PROCESS IMPLEMENTAION By: Nabina Pradhan 10/09/2013.
Processes Chapter 3. Processes  Process is a program in running state  PROCESSES ARE THE BUILDING BLOCKS OF DISTRIBUTED SYSTEMS, ESPECIALLY IN unix.
WWW and HTTP King Fahd University of Petroleum & Minerals
Processes Chapter 3.
Processes Chapter 3.
Processes Chapter 3.
Process/Code Migration and Cloning
Presentation transcript:

Univ. of TehranDistributed Operating Systems1 Advanced Operating Systems University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Process migration Lecture 12: Process migration

Univ. of TehranDistributed Operating Systems2 Covered topic Process migration, Why? And how. References Chapter 3 of the text book Fred Douglis and John Ousterhout, “Transparent Process Migration: Design Alternatives and the Sprite Implementation”

Univ. of TehranDistributed Operating Systems3 Outline Motivation for migration How does migration occur? Resource migration Agent-based system Details of process migration Problems

Univ. of TehranDistributed Operating Systems4 Motivation Key reasons: performance and flexibility Process migration (strong mobility) Improved system-wide performance – better utilization of system-wide resources Idle workstations Code migration (weak mobility) Shipment of server code to client – filling forms (reduce communication, no need to pre-link stubs with client) Ship parts of client application to server instead of data from server to client (e.g., databases) Improve parallelism – agent-based web searches

Univ. of TehranDistributed Operating Systems5 Motivation Flexibility Dynamic configuration of distributed system Clients don’t need preinstalled software – download on demand

Univ. of TehranDistributed Operating Systems6 Migration models Process = code seg + resource seg + execution seg Weak versus strong mobility Weak => transferred code (program) starts from initial the state (Java Applets). Simple Strong => move execution segment 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

Univ. of TehranDistributed Operating Systems7 Who executes migrated entity? Code migration: Execute in a separate process [Applets] Execute in target process Process migration Remote cloning Migrate the process

Univ. of TehranDistributed Operating Systems8 Models for Code Migration Alternatives for code migration.

Univ. of TehranDistributed Operating Systems9 Do Resources Migrate? Depends on resource to process binding By identifier: specific web site, ftp server By value: Java libraries By type: printers, local devices Depends on type of “attachments” Unattached to any node: data files Fastened resources (moved only at high cost) Database, web sites Fixed resources Local devices, communication end points

Univ. of TehranDistributed Operating Systems10 Resource Migration Actions Actions to be taken with respect to the references to local resources when migrating code to another machine. GR: establish global system-wide reference MV: move the resources CP: copy the resource RB: rebind process to locally available resource UnattachedFastenedFixed By identifier By value By type MV (or GR) CP ( or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) RB (or GR, CP) GR RB (or GR) Resource-to machine binding Process-to- resource binding

Univ. of TehranDistributed Operating Systems11 Migration in Heterogeneous Systems Systems can be heterogeneous (different architecture, OS) Support only weak mobility: recompile code, no run time information Strong mobility: recompile code segment, transfer execution segment [migration stack] Virtual machines - interpret source (scripts) or intermediate code [Java] Migration on Only subroutine Or method Call Migrate stack

Univ. of TehranDistributed Operating Systems12 Cost of migration Multiprocessor: nondistributed loss of the lines associated with the process in the processor's instruction a data caches Distributed environment Moving a process's virtual memory Forwarding a process's IPC (local and network) messages, informing senders of the process's new contact information. Moving information of files. the open file table, the file descriptor table, the file offset, dirty blocks in the buffer cache, &c Moving the process's user-level state: registers, stack, &c Moving the process's kernel-level state: pwd, pid, signal masks, &c

Univ. of TehranDistributed Operating Systems13 Cost of migration (partial migration) Migration of the whole process too expensive. Move certain aspects of a process The remaining portions of the process create residual dependencies -- the migrated process still relies on the original host to provide the services that were not migrated.

Univ. of TehranDistributed Operating Systems14 Migrating Virtual memory Freeze and copy migration: Suspend or freeze the process on the original host, and then to copy all of the pages of memory to the new host. Once all done, process can be resumed on the new host. Simple, clean and easy to implement. Does not create a residual dependency Many pages which are never used may be copied and sent over the network If the process is migrated several times, this cost adds up Do nothing while copying?

Univ. of TehranDistributed Operating Systems15 Migrating Virtual memory Precopying: The process runs on the original host, while the pages are being copied. It is clean -- it does not create any residual dependencies. Copying pages that may never be used. Dirty pages must be transferred. Can be more expensive lazy migration: like demand paging. It creates residual dependencies

Univ. of TehranDistributed Operating Systems16 Migrating Virtual memory Distributed file system: a memory-mapped file. the process's memory can be migrated simply by flushing the dirty blocks and mapping the file from a different host. Isn't as clean as it may seem

Univ. of TehranDistributed Operating Systems17 Migrating Communication Channels If a process migrates, its communications must be able to continue. Inform "interested" processes of the new location of a migrating process. Unclean, unnecessary messages, how to know other communicating clients? link redirection or forwarding at the original host of the migrating process. Residual dependency and can increase the latency involved in sending messages to the migrated process, but makes the process of migration itself cheaper

Univ. of TehranDistributed Operating Systems18 Process with open files Show up at the new host and re-open the files. But, in truth, there is a great deal of state associated with an open file. Consider the system-wide open file table, the cached inodes, dirty blocks that may live only in the local buffer cache, &c. fork()'d proceses share the same file offset. it is often much easier to leave the process dependent on the old host for file service.

Univ. of TehranDistributed Operating Systems19 Migrate kernel state It is often easier to leave a migrating process dependent on a prior (or perhaps first) host for these services. Checkpointing and recovery: A process's state to be saved to a file (much like a persistent object) and then a new process to be created (restored) based on this checkpoint file. This checkpoint file contains all of the "goods" including the kernel material.

Univ. of TehranDistributed Operating Systems20 Migrate? Or not migrate? Several things to consider If the home host suffers from a bursty load, it may not make sense to migrate a process -- the home host will be free again, soon. Processes with significant virtual memory or IPC usage or many open files are poor choices for migration. Historical consideration: long running processes are better candidates than recent arrivals – they are likely to continue to run for a long time. Short lived processes are likely to complete shortly after migration, offering little gain to amortize the cost of migration over useful work.

Univ. of TehranDistributed Operating Systems21 Design Issues Measure of load Queue lengths at CPU, CPU utilization Types of policies Static: decisions hardwired into system Dynamic: uses load information Adaptive: policy varies according to load Preemptive versus non-preemptive Centralized versus decentralized Stability:  => instability,         load balance Job floats around and load oscillates

Univ. of TehranDistributed Operating Systems22 Components Transfer policy: when to transfer a process? Threshold-based policies are common and easy Selection policy: which process to transfer? Prefer new processes Transfer cost should be small compared to execution cost Select processes with long execution times Location policy: where to transfer the process? Polling, random, nearest neighbor Information policy: when and from where? Demand driven [only if sender/receiver], time-driven [periodic], state-change-driven [send update if load changes]

Univ. of TehranDistributed Operating Systems23 Sender-initiated Policy Transfer policy Selection policy: newly arrived process Location policy: three variations Random: may generate lots of transfers => limit max transfers Threshold: probe n nodes sequentially Transfer to first node below threshold, if none, keep job Shortest: poll N p nodes in parallel Choose least loaded node below T

Univ. of TehranDistributed Operating Systems24 Receiver-initiated Policy Transfer policy: If departing process causes load < T, find a process from elsewhere Selection policy: newly arrived or partially executed process Location policy: Threshold: probe up to N p other nodes sequentially Transfer from first one above threshold, if none, do nothing Shortest: poll n nodes in parallel, choose node with heaviest load above T

Univ. of TehranDistributed Operating Systems25 Symmetric Policies 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 …

Univ. of TehranDistributed Operating Systems26 Case Study: V-System (Stanford) State-change driven information policy Significant change in CPU/memory utilization is broadcast to all other nodes M least loaded nodes are receivers, others are senders Sender-initiated with new job selection policy Location policy: probe random receiver, if still receiver, transfer job, else try another

Univ. of TehranDistributed Operating Systems27 Sprite (Berkeley) Workstation environment => owner is king! Centralized information policy: coordinator keeps info State-change driven information policy Receiver: workstation with no keyboard/mouse activity for 30 seconds and # active processes < number of processors Selection policy: manually done by user => workstation becomes sender Location policy: sender queries coordinator WS with foreign process becomes sender if user becomes active: selection policy=> home workstation

Univ. of TehranDistributed Operating Systems28 Sprite (contd) Sprite process migration Facilitated by the Sprite file system State transfer Swap everything out Send page tables and file descriptors to receiver Demand page process in Only dependencies are communication-related Redirect communication from home WS to receiver

Univ. of TehranDistributed Operating Systems29 Agents Software agents Autonomous process capable of reacting to, and initiating changes in its environment, possibly in collaboration More than a “process” – can act on its own Mobile agent Capability to move between machines Needs support for strong mobility Example: D’Agents (aka Agent TCL) Support for heterogeneous systems, uses interpreted languages

Univ. of TehranDistributed Operating Systems30 Implementation Issues (1) The architecture of the D'Agents system. Lowest: communication Server: agent manage- ment, comm. Among agent, auth. RTS: start & end agents, Etc.

Univ. of TehranDistributed Operating Systems31 Implementation Issues (2) The parts comprising the state of an agent in D'Agents. StatusDescription Global interpreter variablesVariables needed by the interpreter of an agent Global system variablesReturn codes, error codes, error strings, etc. Global program variablesUser-defined global variables in a program Procedure definitionsDefinitions of scripts to be executed by an agent Stack of commandsStack of commands currently being executed Stack of call frames Stack of activation records, one for each running command

Univ. of TehranDistributed Operating Systems32 Software Agents in Distributed Systems Some important properties by which different types of agents can be distinguished. Property Common to all agents? Description Autonomous YesCan act on its own Reactive YesResponds timely to changes in its environment Proactive YesInitiates actions that affects its environment Communicative Yes Can exchange information with users and other agents Continuous NoHas a relatively long lifespan Mobile NoCan migrate from one site to another Adaptive NoCapable of learning

Univ. of TehranDistributed Operating Systems33 Agent Technology The general model of an agent platform (adapted from [fipa98-mgt]).

Univ. of TehranDistributed Operating Systems34 Agent Communication Languages (1) Examples of different message types in the FIPA ACL [fipa98-acl], giving the purpose of a message, along with the description of the actual message content. Message purposeDescriptionMessage Content INFORM Inform that a given proposition is trueProposition QUERY-IF Query whether a given proposition is trueProposition QUERY-REF Query for a give objectExpression CFP Ask for a proposalProposal specifics PROPOSE Provide a proposalProposal ACCEPT-PROPOSAL Tell that a given proposal is acceptedProposal ID REJECT-PROPOSAL Tell that a given proposal is rejectedProposal ID REQUEST Request that an action be performedAction specification SUBSCRIBE Subscribe to an information source Reference to source

Univ. of TehranDistributed Operating Systems35 Agent Communication Languages (2) A simple example of a FIPA ACL message sent between two agents using Prolog to express genealogy information. FieldValue PurposeINFORM LanguageProlog Ontologygenealogy Contentfemale(beatrix),parent(beatrix,juliana,bernhard)

Univ. of TehranDistributed Operating Systems36 Next Lecture Files in distributed systems. References Chapter 10 of the book. The Google File System