• No se han encontrado resultados

4. MARCO LEGAL EN COSTA RICA

4.1. Ley de certificados, firmas digitales y documentos electrónicos

3.3. Allocation Problem

With Definitions 3.1 and 3.2 for an infrastructure and a workload, respectively, the allocation problem can now be discussed and finally formulated.

3.3.1. Possible Objectives

The allocation problem can be formulated differently to optimize for different ob- jectives (see also Section 3.5 with related approaches). Two basic formulations are: 1. Minimize the number of used resources without violating performance con-

straints!

2. Maximize performance with a given amount of resources!

Both formulations can be extended and customized to further specify the allo- cation problem. Performance constraints and objectives can for instance refer to different performance metrics like throughput or response time. Furthermore, per- formance goals can be formulated for average or worst case behavior and different performance levels can be requested to offer different service levels. Resource con- straints and objectives can for instance refer to the number of nodes, the network communication, or the total energy consumption (e.g., Dargie et al., 2011).

In this thesis, the objective of the allocation problem is to find a valid mapping from the workload to the infrastructure that optimizes the workload performance with a given and fixed number of nodes. Details about the performance metrics used in our experiments are provided in the corresponding Chapters 6 and 7.

Meta-Objectives Given the complexity of the underlying systems, certain behav-

ior may be hard to evaluate without actually materializing a setup and executing the workload. Especially, predicting the performance of a system with respect to response times and throughput is close to impossible due to the complex interactions of concurrently executed tasks. Instead, meta-objectives that can be evaluated are used in practice to achieve the actual goals. For instance, the Schism project (Curino et al., 2010) uses the number of distributed transactions, i.e., the message count4, as a meta-objective. Minimizing the number of transactions that have to communicate is shown to improve performance. Likewise, Quamar et al. (2013) optimize for the query span, i.e., the average number of machines involved in the execution of a query. By minimizing this meta-objective, which can easily be evaluated, the authors hope to indirectly reduce communication overhead, total resource consumption, and en- ergy footprint. However, there is an obvious side-effect (discussed by the authors) of the query span objective that leads to higher response times for analytical queries that would benefit from a higher degree of parallelism.

The objective that we use to optimize performance is to minimize costly com- munication and to balance oversubscribed unbounded resources. The assumption is that network communication is a major cost factor that, given a partitioning, can

4

Optimizing for communication volume is another valid meta-objective that is related but not identical to the message count.

be optimized by the allocation strategy5. The second assumption is that balancing load, especially for oversubscribed resources, leads to the best performance across all tasks. When the load is not balanced, single nodes receive more load than others and the tasks assigned to these nodes are bound to suffer from worse than possible performance.

3.3.2. Possible Constraints

The two basic formulations of the allocation problem focus on performance and resources. One formulation optimizes performance under the constraint of given resources. The other formulation optimizes required resources under performance constraints. On top of the basic formulations of the allocation problem, additional constraints can be incorporated, e.g., to guarantee availability or fault-tolerance (e.g., in Schaffner et al., 2013). Isolation, either from a security point of view or a performance point of view (e.g., Kiefer et al., 2014), may be another constraint. Aspects of maintainability and manageability may also be of importance and incor- porated as constraints in the allocation problem.

Replication is often used to enforce some of the possible constraints, e.g., fault- tolerance. Curino et al. (2011), Kumar et al. (2014), and Schaffner et al. (2013) model replication in their variations of the allocation problem (details in Section 3.5). Replication of data has several aspects to consider. First, it needs to be decided which objects to replicate. Second, the number of replicas needs to be determined. Third, the execution platform needs to support replication (including read and write strategies). The first and the second decision are tradeoffs between the gain of additional replicas and the increased costs for update operations. If modeled in the workload graph, replication is almost independent of the allocation strategy with the only exception that it must be ensured that replicas of the same object are not mapped to the same node. We do not explicitly consider replication in this thesis because it is an orthogonal problem and because it is not a common feature found in all systems that we consider.

3.3.3. Problem Formulation

Given these preconditions, we use the following definition for an allocation and a corresponding formulation for the allocation problem that we try to solve in this thesis.

Definition 3.3 (Allocation). An allocation is a mapping from a workload to an

infrastructure. The mapping assigns vertices of the workload graph to vertices of the infrastructure graph. For each resource, a node’s load is the combined weight (including non-linear behavior) of all workload vertices assigned to that node. An allocation is valid if the load is not greater than the capacity for all bounded resources and for all nodes. An allocation is balanced if the load is equal (within a tolerance) to the average load for all unbounded resources and for all nodes. An allocation’s

5

Note that the tradeoff between parallelism overhead and gain is part of the partitioning problem, not the allocation problem.

3.3. Allocation Problem

communication costsare the sum of all edge weights of edges between vertices that are assigned to different nodes.

Allocation Problem

Given a workload and an infrastructure, the allocation problem is to find a valid and balanced allocation that minimizes communication costs.

Allowing a node’s load to be within a tolerance of the average load is necessary because it may not always be possible to find an allocation that perfectly balances the load. The acceptable degree of imbalance is a tuning parameter of the allocation strategy that has to be provided or empirically determined.

Our proposed solutions to the allocation problem are based on balanced k-way min-cut graph partitioning strategies and will be described in detail in Chapters 4 and 5.

3.3.4. Relations to the Partitioning Problem

Given an allocation strategy, the question remains how to address the partitioning problem. With a workload, an infrastructure, and an allocation, we sketch how to incrementally update the partitioning. Incremental updates to the partitioning are based on two basic operations: (1) splitting of partitions and (2) merging of partitions (both operations can easily be applied to the workload graph). The costs assigned to vertices in the workload graph help to determine candidates for the split operation. Partitions that consume high amounts of processing or memory resources may benefit from a higher degree of parallelism. On the other hand, partitions from the same relation that are assigned to the same node by the allocation strategy are candidates for the merge operation. Given the fact that the allocation strategy tries to minimize communication, the co-location of partitions of the same relation happens implicitly if the degree of parallelism is high. Other candidates for merges are workload vertices that are connected by edges with high edge costs.

Given the candidates, whether or not it is beneficial to perform a split or merge operation is a challenging decision in the partitioning problem.

3.3.5. The Case for Individual Resources

Our infrastructure model contains multiple resources and the allocation problem is formulated such that resources are treated individually, i.e., checked for capacity or balance. Other approaches to the allocation problem propose to combine all re- sources in a single resource that can then be optimized (e.g., Curino et al., 2011, detailed in Section 3.5). However, system resources like CPU or memory are only loosely coupled. Tasks may have a high processing cost with virtually no mem- ory access costs, e.g., when the working set of the task fits in the cache. On the other hand, tasks that perform scans have high memory transfer costs but low pro- cessing costs. To illustrate the problem with combining resources, we conduct an experiment with two resources and show the results in Figure 3.7 (details about the

 1RGHV 6RUWHG      

(a) Node Utilization According to the Sum of Weights

 1RGHV 6RUWHG      

(b) Node Utilization (Weight 1)

 1RGHV 6RUWHG      

(c) Node Utilization (Weight 2) Figure 3.7.: Relative Node Utilizations for the Sum of Weights and Individual

Weights (Node Utilization Normalized to the Average Node Utilization)

experiment are presented in Section 4.5.2). The workload in the experiment contains two resources, i.e., two weights, and the allocation strategy balances the sum of both resources. Figure 3.7a shows the resulting node utilization according to the sum of both resources. However, as shown in Figures 3.7b and 3.7c, the node utilizations are skewed with respect to the individual resources.

As a consequence, an allocation strategy must be able to handle multiple resources individually.