Utility Maximizing Thread Assignment and Resource Allocation
Efficient use of shared resources is a key problem in a wide range of computer systems, from cloud computing to multicore processors. Optimized allocation of resources among users can result in dramatically improved overall system performance. Resource allocation is in general NP-complete, and past works have mostly focused on studying concave performance curves, applying heuristics to nonconcave curves, or finding optimal solutions using slow dynamic programming methods. These approaches have drawbacks in terms of generality, accuracy and efficiency. In this paper, we observe that realistic performance curves are often not concave, but rather can be broken into a small number of concave or convex segments. We present efficient algorithms for optimal and approximately optimal resource allocation leveraging this idea. We also introduce several algorithmic techniques that may be of independent interest. Our optimal algorithm runs in O(snα(m)m(log m)<sup>2</sup>) time, and our approximation algorithm finds a 1 - ε optimal allocation for any ε > 0 in O(s/ε α(n/ε)n<sup>2</sup> log n/ε log m) time; here, s is the number of segments, n the number of processes, m the amount of shared resource, and α is the inverse Ackermann function that is ≤ 4 in practice. Existing exact and approximation algorithms have O(nm<sup>2</sup>) and O(n<sup>2</sup> m/ε) running times, resp., so our algorithms are much faster in the practical case where n <;<; m. Experiments show that our algorithms are 215 times faster than dynamic programming for finding optimal solutions when m = 1M, and produce solutions with 33% better performance than greedy algorithms.