US 7886055 B1 Abstract To perform resource allocation in a system having plural tiers, one of plural resource allocation algorithms is selected in response to determining, based on one or more conditions, which of the plural resource allocation algorithms to select. The selected resource allocation algorithm is used to allocate resources for the plural tiers of the system.
Claims(22) 1. A method comprising:
receiving a request to perform resource allocation in a system having plural tiers;
in response to the request, determining, by at least one processor based on conditions relating to a target computation time and solution quality of an answer to the request, which of plural resource allocation algorithms to select;
selecting, by the at least one processor, one of the plural resource allocation algorithms in response to the determining, wherein selecting one of the plural resource allocation algorithms comprises selecting one of:
a first resource allocation algorithm to provide an approximate solution, and
a second resource allocation algorithm to provide an optimal solution by solving for a multi-choice knapsack problem, wherein the multi-choice knapsack problem includes plural sets of items that correspond to the plural tiers, wherein solving the multi-choice knapsack problem selects an item from each of the sets, each selected item representing an amount of resources for a respective one of the tiers,
wherein the first resource allocation algorithm has a smaller computational time than the second resource allocation algorithm; and
using the selected resource allocation algorithm to allocate resources for the plural tiers of the system.
2. The method of
3. The method of
4. The method of
5. The method of
6. The method of
7. The method of
8. The method of
wherein the first resource allocation algorithm has a smaller computational time than the third resource allocation algorithm, and the third resource allocation algorithm has a smaller computational time than the second resource allocation algorithm.
9. A method comprising:
receiving a request to perform resource allocation in a system having plural tiers;
in response to the request, determining, by at least one processor based on one or more conditions, whether to select an approximate resource allocation algorithm or an optimal resource allocation algorithm, wherein the optimal resource allocation algorithm provides a solution by solving for a multi-choice knapsack problem, wherein the multi-choice knapsack problem includes plural sets of items that correspond to the plural tiers, wherein solving the multi-choice knapsack problem selects an item from each of the sets, each selected item representing an amount of resources for a respective one of the tiers;
selecting, by the at least one processor, one of the approximate resource allocation algorithm and the optimal resource allocation algorithm in response to the determining; and
using the selected resource allocation algorithm to allocate resources for the plural tiers of the system.
10. The method of
11. The method of
12. The method of
13. The method of
14. The method of
15. A non-transitory machine-readable storage medium containing instructions, that when executed by at least one processor, effect resource allocation for a system having plural tiers, comprising:
receiving a request to perform resource allocation in a system having plural tiers;
in response to the request, determining, based on conditions relating to a target computation time and solution quality of an answer to the request, which of plural resource allocation algorithms to select;
selecting one of plural resource allocation algorithms in response to the determining, wherein selecting one of the plural resource allocation algorithms comprises selecting one of:
a first resource allocation algorithm to provide an approximate solution, and
a second resource allocation algorithm to provide an optimal solution by solving for a multi-choice knapsack problem, wherein the multi-choice knapsack problem includes plural sets of items that correspond to the plural tiers, wherein solving the multi-choice knapsack problem selects an item from each of the sets, each selected item representing an amount of resources for a respective one of the tiers,
wherein the first resource allocation algorithm has a smaller computational time than the second resource allocation algorithm; and
using the selected resource allocation algorithm to allocate resources for the plural tiers of the system.
16. The non-transitory machine-readable storage medium of
17. The non-transitory machine-readable storage medium of
18. An apparatus comprising:
a processor;
an interface to receive a request to perform resource allocation for a system having plural tiers; and
a server allocation module executable on the processor to:
in response to the request, determine, based on one or more conditions, which of plural resource allocation algorithms to select;
select one of the plural resource allocation algorithms in response to the determining, wherein the plural resource allocation algorithms include a first resource allocation algorithm to provide an approximate solution, and a second resource allocation algorithm to provide an optimal solution by solving for a multi-choice knapsack problem, wherein the multi-choice knapsack problem includes plural sets of items that correspond to the plural tiers, wherein solving the multi-choice knapsack problem selects an item from each of the sets, each selected item representing an amount of resources for a respective one of the tiers; and
use the selected resource allocation algorithm to allocate resources for the plural tiers of the system.
19. The apparatus of
20. The apparatus of
21. The apparatus of
22. A method comprising:
receiving a request to perform server allocation in a system having plural tiers;
in response to the request, selecting, by at least one processor, one of plural server allocation algorithms; and
using, by the at least one processor, the selected server allocation algorithm to allocate numbers of servers for the plural tiers of the system,
wherein the plural server allocation algorithms include:
a two-approximation server allocation algorithm that calculates fractional, non-integers numbers of servers for the respective tiers, and rounds up the fractional, non-integer numbers to integer numbers to represent allocated numbers of servers for respective tiers, wherein the two-approximation server allocation algorithm achieves an approximate minimum cost, the approximate minimum cost being less than twice an optimal minimum cost associated with an optimum solution;
a pseudo-polynomial exact algorithm to produce the optimum solution for the numbers of servers for the respective plural tiers, the pseudo-polynomial exact algorithm defining plural sets of items for a multi-choice knapsack problem, the plural sets corresponding to the plural tiers, and the pseudo-polynomial exact algorithm solving the multi-choice knapsack problem to select an item from each of the sets, each item representing a number of servers for a respective one of the tiers; and
a fully-polynomial approximate algorithm that defines plural sets of items for a multi-choice knapsack problem, where each set defined by the fully-polynomial approximate algorithm contains items associated with scaled down costs to reduce numbers of items in respective sets.
Description This is related to U.S. patent application Ser. No. 11/116,728, entitled “Allocation of Resources for Tiers of a Multi-Tiered System Based on Selecting Items from Respective Sets,” filed Apr. 28, 2005. Web-based resources, such as online information, online retail sites, and other web resources, are widely available to users over networks such as the Internet and intranets. Access to a web resource is provided by a website, which is typically implemented with a server system having one or more servers. Traffic at a popular website can be relatively heavy. If an insufficient number of servers are allocated to a website, then response times experienced by users when visiting the website can be long. Typically, a server system that provides a website has a multi-tiered architecture that includes multiple tiers of servers. A user request submitted to the server system is typically processed by all the tiers. Thus, the total response time for a user request is the sum of the response times at respective tiers. The expected response time at each tier depends upon the number of servers allocated to the tier. A web-based, multi-tiered architecture typically includes three tiers of servers: web servers, application servers, and database servers. Web servers communicate with the user (at a client system) and serve as the interface between the application servers and the user. Application servers parse user requests and perform predefined computations. Application servers in turn communicate with database servers to access requested information. Conventional techniques have been proposed to allocate an adequate number of servers to each tier of a multi-tiered architecture to meet a desired response time constraint. However, conventional techniques for allocating the number of servers in each tier of a multi-tiered architecture employ algorithms that have processing times related exponentially to the input problem size. In other words, as the number of tiers of the multi-tiered server system increases, the processing time for computing the allocation of servers in each tier increases exponentially. Consequently, the amount of processing time involved in performing server allocation using conventional techniques for a multi-tiered server system can be relatively large. Also, conventional techniques are inflexible in that, in a particular system, users typically are limited to using one server allocation algorithm to address the server allocation issue. For example, as user traffic at a server system increases, servers from the server pool A “server” refers to a computer, a collection of computers, or any part of a computer (whether software or hardware or a combination of both). As depicted in A server management system The server management system Also, although described in the context of software modules, it is contemplated that the server allocation and server monitoring tasks can be performed by hardware, or by a combination of hardware or firmware, in other embodiments. The server allocation module Although reference is made to allocating servers to tiers of a server system, it is contemplated that other types of resources (e.g., CPUs, memory, etc.) can be allocated to plural tiers of any multi-tiered computer, according to alternative embodiments. In accordance with some embodiments of the invention, for enhanced flexibility, the server allocation module In one embodiment, the server allocation module The first server allocation algorithm The second server allocation algorithm The third server allocation algorithm Note that the first and third algorithms produce feasible solutions regarding the numbers of servers for respective tiers that satisfy the response time constraint, but the solutions are not optimal (but rather are approximate) in the sense that the solutions do not achieve optimal (e.g., minimum) cost. However, the second algorithm produces a solution that achieves optimal (e.g., minimum) cost. A property of a multi-tiered server system architecture is that the delay experienced by a request in each tier depends upon the number of servers in that tier and is not affected by the number of servers in any other tier. Thus, according to some embodiments, the response time for a request can be computed by summing the delays in individual tiers to obtain the total response time. In one embodiment, the server allocation module
In the equation, h Use of the approximation algorithms (e.g., first and third server allocation algorithms Using server allocation techniques according to some embodiments, user control of running time and solution quality is provided. Selection (either by user or the server management system In the response time model according to an example implementation, if the request arrival rate is λ The parameter E[S From Eq. 3, it follows that there exist multiple server configurations satisfying a given response time constraint. Among these multiple feasible allocations, it is desired to find the one configuration that has the minimum cost. Finding the configuration with the minimum cost can be formulated as the following optimization problem:
Note that the response time constraint takes into account the incoming workload, λ Selection of the algorithm (at Thus, in the context where a relatively quick answer is desirable, the server management system In response to determining that the first algorithm The Lagrangian multiplier method uses a Lagrangian function where λ is the Lagrangian multiplier:
Note that N
Solving for N
The fractional value N
Substituting the expression set equal to N
Then the cost of the relaxed Lagrangian solution is calculated (at
The optimal fractional solution N An output of the two-approximation server allocation algorithm ( If the server allocation module The multi-choice knapsack problem is a generalization of the ordinary knapsack problem, in which there are m sets of items S When applied to the server allocation problem with k tiers, the multi-choice knapsack problem includes k sets of items S
The parameter weight(j) represents the response time for j servers in tier i, and the parameter cost(j) represents the cost of j servers at tier i. For the server allocation optimization problem, there is no cost constraint; thus any j>b To reduce the size of input sets S
Thus, n
Thus, n Given n Solving the multi-choice knapsack problem causes selection of items from respective sets S Once the first row is computed, the subsequent rows (2, 3, . . . , k) of the DP table F(,) are built using the following recursion function:
According to Eq. 16, F(i,c) is an aggregate value derived by summing the F(,) value from a previous row F(i−1, c−cost(j)) and the weight value, weight(j) (response time), of the current row, based on a selected j (number of servers) from set S F(i,c) represents the minimum response time given a fixed cost c (derived based on cost(j)) for the first i tiers. From the two-approximation algorithm, C Once the DP table has been built, an optimal solution is found (at In other words, in step Let A be an output array to hold the optimal solution, where each entry of the output array A is equal to the optimal number of servers for a respective tier. In other words, A[i], i=1, . . . , k, represents the optimal number of servers in the i-th tier. To calculate the values for A, the server allocation module The backtrack algorithm starts with i=k, c=c In terms of performance, the above algorithm runs in time O(C As explained above, the two-approximation algorithm (the first server allocation algorithm The pseudo-polynomial-time algorithm described above can be converted into a fully-polynomial-time approximation scheme using cost scaling. The approximation scheme is almost identical to the pseudo-polynomial time algorithm, with the difference that a scaled down cost for each item is used and calculated (at
The scaled down cost scost(j) replaces the cost(j) value associated with the second server allocation algorithm that is associated with items j in each set of the multi-choice knapsack problem. The value ε is selected based on the level of accuracy desired—a low ε value provides greater accuracy but involves greater processing time. Let S′ The set S′ To save storage space, not all the S′ With costs scaled, the cost of the optimal solution is bounded by k·1/ε. There are k rows of the DP table, with each row of the DP table having length k/ε (that is, B=k/ε, where B represents the number of columns in the DP table), and each cell takes time O(k/ε) to compute. Thus, the total processing time becomes O(k Each item of a set S′ Instructions of such software routines described above are loaded for execution on processors (such as CPU(s) Data and instructions (of the software) are stored in respective storage devices, which are implemented as one or more machine-readable storage media. The storage media include different forms of memory including semiconductor memory devices such as dynamic or static random access memories (DRAMs or SRAMs), erasable and programmable read-only memories (EPROMs), electrically erasable and programmable read-only memories (EEPROMs) and flash memories; magnetic disks such as fixed, floppy and removable disks; other magnetic media including tape; and optical media such as compact disks (CDs) or digital video disks (DVDs). In the foregoing description, numerous details are set forth to provide an understanding of the present invention. However, it will be understood by those skilled in the art that the present invention may be practiced without these details. While the invention has been disclosed with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover such modifications and variations as fall within the true spirit and scope of the invention. Patent Citations
Non-Patent Citations
Referenced by
Classifications
Legal Events
Rotate |