21
BY RITU RANJAN SHRIVASTWA PROCESSOR ALLOCATION Distribut ed Systems

Processor allocation in Distributed Systems

Embed Size (px)

DESCRIPTION

Allocation of processors to processes in Distributed Systems. Strategies or algorithms for processor allocation. Design and Implementation Issues of Strategies.

Citation preview

Page 1: Processor allocation in Distributed Systems

BY R I T U RA N JA N S H R I VA S T WA

PROCESSOR ALLOCATION

Dis

trib

ute

d

Syst

em

s

Page 2: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

WHAT YOU WILL LEARN?

Why Distributed Systems need processor allocation

How performance of Distributed Systems can be enhanced by using different Processor allocation

strategies

What are the issues that we face while designing a processor allocation strategy

Page 3: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

MOTIVATION

• We are talking about distributed systems, hence multiple connected machines

• A good algorithm is always appreciated• Speeds up Computation

• Proper use of resources

• Minimizing CPU Idle time

• Concept of using idle workstations is a weak attempt at recapturing the wasted cycles

• Using a single 1000-MIPS CPU may be much more expensive than 100 10-MIPS CPU, then the Price/Performance ratio of the latter is much better. (It may also not be possible to build a much higher performance CPU)

Highest Performance system has:

3,120,000 cores at 2.2 GHz54,902.4 TFLOPS/s

Page 4: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

ALLOCATION MODELS

• Before talking about allocating processor, we make assumptions about the allocation models:• All machines are identical or at least code compatible• They differ at most by speed (MIPS or FLOPS)• Homogeneity (architecture)• The system is fully connected (doesn’t always mean a

wire to each system; just that transport connections can be established)

• New work is generated when a process decides to fork or otherwise create a sub-process

Page 5: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

PROCESSOR ALLOCATION STRATEGIES

• NONMIGRATORY• A process when created is assigned a machine where it

stays until it terminates. It doesn’t matter how overloaded the machine becomes or how many other machines are idle.

• MIGRATORY• In contrast, a process can be moved even after execution

hence allowing better load balancing.• Although these provide better load balancing, they have

a major impact on system design

Page 6: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

AN EXAMPLE OF PROCESSOR ALLOCATION TO GIVE AN IDEA OF THE NEED

MeanResponse Time

Processor1 <- AProcessor2 <- B=(10+8)/2 = 9 sec

Processor1 <- BProcessor2 <- A=(30+6)/2 = 18 sec

Q. Which allocation is better?

Page 7: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

AN EXAMPLE OF PROCESSOR ALLOCATION TO GIVE AN IDEA OF THE NEED

MeanResponse Time

Processor1 <- AProcessor2 <- B=(10+8)/2 = 9 sec

Processor1 <- BProcessor2 <- A=(30+6)/2 = 18 sec

Q. Which allocation is better?

Page 8: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

ISSUES IN PROCESSOR ALLOCATION

• Design Issues• Deterministic vs Heuristic Algorithms• Centralized vs Distributed Algorithms• Optimal vs Sub-optimal Algorithms• Local vs Global Algorithms• Sender-initiated vs Receiver-initiated Algorithms

• Implementation Issues

Page 9: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

DETERMINISTIC VS HEURISTIC ALGORITHMS

• Deterministic• All information regarding processes is known (for

example: computing requirements, file requirements, communication requirements, etc.)

• Total information is not always available but approximations can be done. For example: In Banking, Insurance, Airline Reservation, today’s work is just like yesterdays so nature of workload can at least be statistically characterized.

• Heuristic• Workload is completely unpredictable• Requests for work may change dramatically from hour to

hour or minute to minute

Page 10: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

CENTRALIZED VS DISTRIBUTED

• Centralized• Collecting all the information at one place

(machine/system) allows better decision to be made but is less robust and can put a heavy load on the central machine.

• Distributed• Opposite to centralized (may also be termed as

Decentralized). Here there is no central machine and algorithm is implemented on all the machines.

Page 11: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

OPTIMAL VS SUB-OPTIMAL

• Depends upon the first two issues• Are we trying to find best solution or simply an

acceptable one• Optimal Solutions can be found out in both

centralize and distributed systems but finding optimal solution may be costly as they involve collecting more information and processing it more thoroughly.• In practice we use Heuristic, Distributed and Sub-

optimal solutions

Page 12: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

LOCAL VS GLOBAL

• Deciding whether to keep a new born or forked process in the same machine or transferring to other• Crude algorithms suggest to keep the newly born

process to the same machine if the workload on that machine is below threshold value. But this technique may be far from optimal.• A better approach is to keep information of all the

systems and decide upon which system to be allocated with the new process. This can provide a slight better result than the local technique but at a much higher cost.

Page 13: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

SENDER-INITIATED VS RECEIVER-INITIATED ALGORITHMS

• This issue deals with location policy• Once transfer policy decides whether to keep a process or

not, this comes into play

Sender Initiated Receiver Initiated

Page 14: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

IMPLEMENTATION ISSUES

• Calculating work load (not an easy task)• A way suggests to count the total no. of processes and use the number

as the load – but on idle systems even there are various processes that keep on running in background so process count says nothing about current load)

• A second way is to count just the running or ready processes• A more direct measure is to capture the busy time of the CPU that can

be achieved by setting a timer to generate periodic interrupts that records the current CPU status. Con: Interrupts are switched off when kernel executes critical code. This may lead to faulty readings and will tend to underestimate the true CPU usage

• Another implementation takes into consideration the Overhead of the algorithms (during transferring processes) but is not easy so most algorithms ignore it

• Next we consider complexity of the algorithm as an issue. (The algorithm may produce better results but its running time degrades the outcome and which may not be better than existing algorithms). An example.

Page 15: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

PROCESSOR ALLOCATION ALGORITHMS

• There are many algorithms like• A GRAPH-THEORETIC DETERMINISTIC ALGORITHM• A CENTRALIZED ALGORITHM• A HIERARCHICAL ALGORITHM• A SENDER-INITIATED DISTRIBUTED HEURISTIC

ALGORITHM• A RECEIVER INITITATED DISTRIBUTED HEURISTIC

ALGORITHM• A BIDDING ALGORITHM

• In this part we will study only about• A GRAPH-THEORETIC DETERMINISTIC ALGORITHM

Page 16: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

A GRAPH-THEORETIC DETERMINISTIC ALGORITHM

• Recall assumptions of Deterministic Algorithms• Here the communication requirements are known

• There can be more processes than processors• In which case multiple processes are allocated to one

processor

• The system can be represented as a weighted graph• Each node is a process• Each arc (edge) represents the flow of messages between

two processes

• Lets take a scenario where there are 3 processors and 9 processes

Page 17: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

A GRAPH-THEORETIC DETERMINISTIC ALGORITHM (CONTD.)

• The weighted graph would look like

Page 18: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

A GRAPH-THEORETIC DETERMINISTIC ALGORITHM (CONTD.)

• The problem is reduced to finding a way to partition (i.e., cut) the graph into k disjoint sub-graphs, subject to certain constraints (e.g., total CPU and memory req. below some limits for each sub-graph) • Arcs joining two sub-graphs will represent network traffic• Arcs joining two processes within a sub-graph can be

ignored as it is intra-machine communication.

• Goal is to find the partitioning that minimizes the network traffic while meeting all the constraints.

Page 19: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

A GRAPH-THEORETIC DETERMINISTIC ALGORITHM (CONTD.)

Partitioning the graph to allocate 9 processes to 3 processorsNetwork traffic = ∑En [sum of all network edges]

= 30

We can also partition the graph differently, as we will see in the next slide

CPU1 CPU 2 CPU3

Page 20: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

A GRAPH-THEORETIC DETERMINISTIC ALGORITHM (CONTD.)

Partitioning the graph to allocate 9 processes to 3 processorsNetwork traffic = ∑En [sum of all network edges]

= 28

Clearly we can see that a different approach reduces network traffic

CPU1 CPU 2 CPU3

Page 21: Processor allocation in Distributed Systems

RITU RANJAN SHRIVASTWA

POST QUESTIONS OR COMMENTS BELOW