next up previous contents
Next: Summary Up: Algorithms for Load Distribution Previous: Migration Algorithms

The Resource Based Algorithms

 

The Resource based algorithms described in this chapter seek to maintain the process mix hypothesis, which is:

Process Mix: The distribution of a balanced mix of CPU, memory and IO bound processes to each host will lead to the more effective use of resources and delay the onset of bottlenecking.

Difficulties arise from restrictions imposed by both the real time constraints of a computer system, and the implementation practicalities of a load distribution mechanism. Either of these restrictions can degrade or obscure the effect of load distribution, and make the algorithm useless for evaluating the hypothesis.

To truly maintain the process mix of a system, would require an instantaneous and free redistribution of all processes in the system. The problem can be simplified to one of reducing the imbalance in demand for individual resources within a host and between the hosts, which is a much more realistic proposition.

This approximation is equivalent to the process mix hypothesis, under the restriction that only one process or job may be distributed at any one time. This equivalence arises in the following way:

The remainder of this section is devoted to describing the implementation details of the resource based algorithms. The common metric and fitting techniques are developed in sections 8.3.1 to 8.3.2 and the resulting initial placement and process migration algorithms are presented in sections 8.3.3 and 8.3.4 respectively.

Resource Balancing Metric

 

The n resources a host can provide to service processes can be considered to form an n dimensional space. In particular, if a host provides CPU, file IO and memory, then these form a 3 dimensional space, in which a single point locates the current state of the host.

If the values of resource use are constrained to the range of tex2html_wrap_inline6202 , then a completely unloaded host would locate at the origin <0,0,0> and a completely loaded host would be located on the opposite corner at <1,1,1>. This space is illustrated in figure  tex2html_wrap6214

  figure1690
Figure 8.3: The 3 dimensional space used to describe current host state, and the three points indicate potential host loads.

Examination of this space identifies two separate components of the load on a host:

To enable hosts to be ranked for placement suitability, a single metric is required to combine these two load components. One metric is to measure the Euclidean distance between the point and the origin, or in slightly different terms, the norm (length) of the vector from the origin to the point. This is shown graphically with two resource dimensions in Figure  tex2html_wrap6215 tex2html_wrap_inline6208 , is ranked equal to a less balanced, yet more lightly loadedgif host a.

This tradeoff between balance and load works due the property that a vector on the diagonal always encloses a greater volume than one of equal length offset to either side.

  figure1699
Figure 8.4: The different volumes enclosed by two vectors with the same norm (length).

The area (load) alone is not suitable for ranking hosts a and b, as this ranking would always prefer a to b, and therefore does not account for the fact that resource 1 is closer to saturation. The variance of the host resources is also not sufficient on its own, as it provides no means of detecting an overloaded host (just an unbalanced one).

Thus if two hosts are to be compared, the norm provides a simple means of ranking them when both balance and load are significant.

Resource Fitting

 

Section 8.3.1 detailed how a 3 dimensional vector can be used to describe the current state of the host, and that the norm of this vector can be used to rank host loads. Jobs can also be described and ranked using these same resource dimensions, and if they are expressed in the same units as the host, the job can be added to and subtracted from the host vector. The unit that most naturally expresses both the resource availability on a host, and resource demand from a process is utilisation. This enables jobs to be trial fitted to hosts in order to select the one that is most suitable.

There are three standard methods of fitting resource requests to resources available that can be adapted from the domain of physical memory allocation.

There are a number of differences in the application of the physical memory fitting algorithms when used for allocating host resources. Firstly, physical memory is a finite resource and cannot be over allocated, whereas host resource limits are softer and can withstand a degree of overallocation yet still satisfy the request. Secondly, the ideal situation is to completely allocate a segment of physical memory leaving other segments completely free (ignoring fragmentation), this is opposite to the desired effect of host resource allocation, where it is desirable to have all hosts with the same degree of allocated resources (in other words, as condensed versus as spread, as possible).

At this point it is useful to describe the fitting methods in more detail before discussing the actual load distribution algorithms.

First Fit

First fit consists of two functions, the selection and the fitting. These two phases are often intertwined as in the fastest response of V [TLC85], described in section 2.3.5. The essence of this system is that the first host to reply to a multicast request, by its very reply implies that it has sufficient resources to service the request. The first fit implementation described in this section has a more explicit fitting phase.

For a resource based algorithm, first fit can be implemented by adding the components of the job and host vectors, and comparing the results to the maximum value defined for each component. If none of the maximums are exceeded, the job is considered to fit, and is executed on that host.

Best Fit

The best fit from Cena et al. [CCG95] detailed in section 4.2.5, attempted a best fit based on specified job resource requirements. The goal of this scheme is to ensure the highest degree of remaining allocable resources in a heterogeneous system. It did not attempt to mix the processes on a host to ensure complementary behaviour.

Best fit requires that the resource request is most closely satisfied, which has the direct effect of loading up already loaded hosts, in order to leave the larger `more allocable' blocks free. This is contrary to the basic aim of load distribution, and for this reason alone, best fit is not pursued any further in this thesis.

Worst Fit

Worst fit operates in the opposite way to best fit. Instead of choosing the closest fit, worst fit selects the host that results in the largest leftover. This is implemented by selecting the host for which the addition of the job results in the smallest norm as shown graphically by figure  tex2html_wrap6218

  figure1721
Figure 8.5: In this 2D space formed by resources 1 and 2, there are two hosts M1 and M2, of equal load. M1 is heavily utilising resource 1 and host 2 is heavily utilising resource 2. Job j, which is resource 1 bound, is trial added to both hosts. The resulting length of L2 is less than L1, and therefore the job is allocated to M2.

This fitting technique is used to approximate the maintenance of the process mix on each host.

Summary

From this discussion on resource fitting it is clear that there are two fitting techniques suitable for load distribution, first and worst fit. Finding the worst fit approximates the maintenance of a balanced process mix, and is a reasonable approach for both initial placement and process migration. In contrast, first fit does not maintain the process mix nor is it a natural location policy for process migration, and as such, the only first fit algorithm implemented uses initial placement.

As the fitting techniques are borrowed from physical memory allocation, the names are somewhat unsuitable. I will however continue to refer to each technique by its original name to avoid confusion.

Resource Based Initial Placement

 

Resource based initial placement needs the resource usage of a job in order to fit it to the most suitable host. Since initial placement requires that jobs are scheduled before execution, any resource requirements must be provided by estimates based on historical behaviour.

First Fit

First fit initial placement (ff-ip) is a direct implementation of section 8.3.2.

The implementation of the first fit algorithm uses the periodic global state information provided by the periodic updates. First fitting occurs in a cyclic fashion starting at the host following the last successful fit. The new load is estimated after each placement and this is described on page gif.

Thus ff-ip can be summarised by:

First fit uses the standard prediction mechanism to provide job resource requirements prior to execution.

Worst Fit

Worst fit initial placement (wf-ip) seeks to locate the host i that results in the shortest norm of the sum of the host, tex2html_wrap_inline6245 , and job, tex2html_wrap_inline6231 , vectors.

In summary, wf-ip consists of the following:

Closeness

As an alternative to using a load threshold, the location policy could be extended to consider the difference between the local and selected host's norms. If they are within some closeness factor, say a percentage difference, then the local host should be selected.

Load Estimation

 

The load distribution mechanism supplies periodic global state updates to all of the load distribution policies. This presents a problem for the two initial placement fitting algorithms, as no immediate feedback to a job placement is provided. Therefore fittings subsequent to the first in each period are made with data that is known to be out of date, and similar problems to those encountered by the least loaded initial placement algorithm may arise.

One advantage of using predicted resource requirements is that the same trial fitting technique that is used to select the destination host, can be used to provide an estimate of the load after job placement. Thus the result of the fitting computation is used to directly update the load value stored for the destination host.

No explicit action is taken to correct the load estimates, even when a short job (less than the remaining period) is scheduled, as I have assumed that the periodic state update is sufficient to correct for this.

Worst Fit Migration

  

Process migration presents greater choice in the implementation of resource balancing than the equivalent initial placement scheme. The primary reason being, that any process being executed in the system may be selected at any time, compared to initial placement, where only an arriving job can be considered for remote execution.

Therefore two process migration approaches are presented for worst fit, rather than only one as with initial placement.

Whilst on the surface these two approaches appear similar, the first chooses the best candidate to suit the source and destination hosts, while the second chooses the destination to best suit the candidate.

The `better' alternative will be determined experimentally in chapter 9.

As with hbd-mig, all of the resource based process migration algorithms are periodic. They require global host state information, and as a consequence their activity follows the global state update. There is at most one migration in the system per global state update, and therefore both approaches must be considered as load levelling rather than load balancing. As migration is initiated after each global state update, any migration decisions are made with the most recently available data, and there is no need to estimate the load between updates.

Candidate Eligibility

Both migration approaches share the same eligibility test in the candidate selection policy, which is incidentally the same as for ll-mig:

displaymath6249

where,

and e = |E|.

Fairest Candidate

 

This algorithm consists of two major parts, the location selection and the candidate selection:

Fairest worst fit is summarised as:

Highest Contributing Candidate

This differs from the previous algorithm in that the candidate process is selected before the destination host, and therefore there are no conflicting requirements to meet in the selection of the candidate process.

Highest contributing worst fit is summarised as:


next up previous contents
Next: Summary Up: Algorithms for Load Distribution Previous: Migration Algorithms

Kris Bubendorfer
Fri Nov 1 11:26:21 NZDT 1996