Databases often handle large heterogeneous sets of queries that must be scheduled for processing. Moreover, queries often change due to the dynamic nature of workloads associated with the queries. Various tactics may be used to group and schedule the queries for processing in an efficient manner.
The processing of queries directly affects database performance. The numerous scheduling possibilities can result in database resources being either underutilized or saturated. Both processing extremes may represent poor use of the system.
Certain exemplary embodiments are described in the following detailed description and in reference to the drawings, in which:
Embodiments of the invention provide an efficient tool for processing queries using appropriate multi-programming level (MPL) settings. For each combination of MPL settings, points are strategically selected to test and search for an operating envelope that encompasses satisfactory settings for all user loads, even when the service level objectives are heterogeneous.
The system 100 may include a server 102, and one or more client computers 104, in communication over a network 106. As illustrated in
The network 106 may be a local area network (LAN), a wide area network (WAN), or another network configuration. The network 106 may include routers, switches, modems, or any other kind of interface device used for interconnection. The network 106 may connect to several client computers 104. Through the network 106, several client computers 104 may connect to the server 102. The client computers 104 may be similarly structured as the server 102.
The server 102 may have other units operatively coupled to the processor 108 through the bus 110. These units may include tangible, machine-readable storage media, such as storage 122. The storage 122 may include any combinations of hard drives, read-only memory (ROM), random access memory (RAM), RAM drives, flash drives, optical drives, cache memory, and the like. The storage 122 may include the software used in an embodiment of the present techniques. For example, a workload manager 124 may utilize storage 122. In an embodiment, the workload manager 124 may interface with a database management system (DBMS) 126. Although the DBMS 126 and workload manager 124 are shown to reside on server 102, a person of ordinary skill in the art would appreciate that the DBMS 126 and workload manager 124 may reside on the server 102 or any of the client computers 104.
As illustrated, the system 123 may include a DBMS 126. The DBMS 126 can be part of the query control loop 128, along with workload manager 124. Workload manager 124 may include an admission controller 130, a scheduler 132, and an execution controller 134. The admission controller 130 determines which queries 144 should be rejected outright and which queries 144 should be admitted to the database system. The scheduler 132 determines when the DBMS 126 should run each query 144 and which queries 144 should run concurrently. The execution controller 134 determines what action to take, if any, upon an executing query 144. For example, the execution controller may suspend, kill, or abort and resubmit a running query 144. In an embodiment of the invention, the workload manager 124 and DBMS 126 can communicate with one another, such that the workload manager 124 and DBMS 126 can send messages to and receive messages from one another.
The workload manager 124 may also be a member of the policy control loop 136, along with policy controller 138. Although not displayed, the policy controller 138 may be a component of the workload manager 124. In an embodiment of the invention, the workload manager 124 and policy controller 138 can communicate with one another, such that the workload manager 124 and policy controller 138 can send messages to and receive messages from one another. The policy controller 138 may set rules by which the admission controller 130, scheduler 132, and execution controller 134 make decisions. The decisions made by the admission controller 130, scheduler 132, and execution controller 134 are used to ensure system conditions are within the operating envelope.
For example, the policy controller 138 may set a scheduling policy that specifies a threshold (upper limit) on the number of queries 144 that the scheduler 132 will schedule to execute simultaneously. This threshold is commonly referred to as an MPL.
A workload 140 consists of queries 144 and service level objectives 146. Service level objectives 146 may describe performance, such as average response time, throughput, and velocity and may be referred to as performance metrics or simply objectives. The queries 144 and service level objectives 146 taken in combination may form a user load 148. The workload 140 can contain n different user loads 148. In addition, workload objectives 150 can be provided to the workload 140. A complex workload objective 150 may include the possibility that a workload 140 contains multiple subsets of queries 144. Each subset of queries 144 may have distinct objectives. In an embodiment of the invention, the workload manager 124 and the workload 140 may be able to communicate with each other.
Each user load 148 may have one or more service level objectives 146 that can be formulated based on the performance metrics. For example, an Online Transaction Processing-type user load may have throughput and average response-time requirements, while a report-type user load 148 has a deadline. The workload manager 124 may set control parameters with regard to each user load 148. Control parameters may include the number of concurrently executing queries 144 corresponding to an MPL. The MPL associated with each user load can be a measure of estimated main memory consumption and control the processing of the respective user load. As a result, the MPL for each user load indirectly affects database performance.
Using the MPL, the workload manager 124 can identify and record, for any combination of user loads, the boundary for each user load between acceptable and unacceptable performance. These boundaries can be referred to as isocontours, due to the fact that instead of representing raw performance for a particular combination of MPL settings, they represent combinations of settings at which performance is at an acceptable level. The isocontours yield a model that can be intelligently searched to find control parameter settings that meet the service level objectives of all active user loads. In the event that no suitable control parameter settings exist, the search for such settings can gracefully fail.
Table 1 shows the nomenclature used in this approach.
u(X)
The equation Xεn may be used to denote a tuple of n discrete control parameter values [xi, . . . , xn], xiε1≦i≦n. Further, the term xi may be used to denote the control parameter value for user load ui, and the term ƒ may be used to denote a function that maps the control parameter values [x1, . . . , xn] to a service level objective such as throughput or average response time. For ease of disclosure, the function ƒ can be required to return high values for “better performance.” This requirement may be trivial for service level objectives such as throughput. For service level objectives like average response time, function ƒ may return the negative value of the actual measurement, however, the negative value may correspond to better performance.
The term m may be used to denote a constant performance measurement as might be returned by ƒ(X). Accordingly, an isocontour with “height” m may be defined for a user load ui as the set of tuples X=[x1, . . . , xi, . . . , xn] for which function ƒ(X) is greater than m. Further, evaluating function ƒ at tuples X′=[x1, xi−1, x′i, xi+1, xn] with x′i>xi results in a value less than m as shown in the following equation:
In order to distinguish isocontours for different user loads, Iƒ,u may represent the ƒ isocontour for a user load u1. Accordingly, u1 and u2 may denote two user loads. The amount of queries processed for each user load is controlled with MPL. Further, m1 and m2 may denote the MPL values for u1 and u2, and tpi([m1, m2]) may denote the throughput monitored with MPL settings. Thus, the throughput-isocontour for u1 with performance of “height”
is set of [m1, m2] values where the u1 throughput at [m1, m2] is greater than or equal to
such that:
A level set can denote the set of points Lƒ(m)={X=[x1, . . . , xn]|ƒ(X)>m}. The level set may represent all control parameter values that result in better performance, as described herein, than the performance value mapped by the isocontour. As a consequence, level sets for less restrictive performance values can contain the isocontours for “more restrictive” performance values, such that Lu(c′u)⊂Lu(cu) if performance value c′u is more restrictive than performance value cu. Appropriately, the shape of the isocontours and the resulting level sets depend on the resources available to process a user load. If L′u(cu) represents the level set when fewer resources are available to the user load, such as when the user load is run on a “smaller” system, then L′u(cu) ⊂Lu(cu).
Isocontours and level sets for a user load can be illustrated with an n-dimensional plot, where there are n control parameters. Geometrically, the level set denotes the area below the surface spanned by the respective isocontour.
If the interaction between two or more user loads is dominated by negative interactions between heterogeneous sets of queries, the resulting isocontour of each negative user load will be convex as shown in
The term Cu may denote the set of service level objectives and u(X) may denote the set of performance measurements of user load u taken with control parameter settings X. Accordingly, a relation ≦F may be defined that allows a measurement (X) to be defined as “better” than another measurement (X′). The relation ≦F defines an order on the two measurements as follows: (X′)≦F(X)∀1≦i≦k:(X′)[i]≦(X)[i]. In this equation, (X)[i] may denote the ith element of the tuple. Two measurements are not comparable if different pairs of their respective elements are ordered differently. Note that relation ≦F can also be used to compare measurements u with objectives Cu.
From the workload management point of view, threshold settings that satisfy all objectives C=∪uεU Cu of the user loads are of interest. Any threshold settings that are located in the overlap of the level sets of all user loads U may satisfy this requirement. Formally, the operating envelope Ou can be defined for a workload consisting of the user loads U as Ou=∩uεU∩uεC
Once the operating envelope is found, a distance function that calculates the distance between points on different isocontours is defined. Utility functions for deciding how to make trade-offs can then be defined in terms of this distance function. For example, one isocontour may represent MPL settings under which one user load meets a throughput requirement, and another isocontour may represent MPL settings under which another user load meets an average response time per query requirement. One utility function may choose to maximize throughput of the first user load. Another utility function may choose to minimize the average response time of the second user load.
At block 302, an isocontour is defined based on the constant performance metric for each user load. At block 304, the isocontours are evaluated using one or more workload management parameter settings. The workload management parameter settings could include, for example, limiting the number of queries from each user load that execute concurrently at any point in time.
At block 306, an operating envelope is calculated by correlating the isocontours of multiple user loads. At block 308, a message is sent to a workload manager with workload management parameter settings. The workload management parameter settings enable the workload to execute within the calculated operating envelope for multiple user loads.
At block 402, the service level objectives are determined for each user load. At block 404, an expansion phase is performed by increasing the control parameter value exponentially at each service level objective in each user load until a value x is met that satisfies each service level objective in each user load. At block 406, a determination is made as to whether a value x exists. If the value x exists, process flow resumes at block 408. If the value x does not exist, process flow resumes at block 410.
At block 408, a search interval is defined where the minimum value is equal to the control parameter value prior to the value x, and the maximum value is equal to the control parameter value after the value x. At this point, a Fibonacci search is performed. Fibonacci searches are well known in the art. This particular version of the Fibonacci search completes when it has found the maximum point of the MPL throughput curve.
If the value x does not exist, at block 410 performance measurements are compared to determine if the previous performance measurement indicates better performance than the current performance measurement. If the previous performance measurement indicates better performance than the current performance measurement, the process flow resumes at block 412. If the if the previous performance measurement does not indicate better performance than the current performance measurement, the method 400 ends. At block 410, a slightly modified Fibonacci search is used. The modified Fibonacci search terminates as soon as it has found an MPL value that exceeds the designated objectives Cu. If no control parameter value exists where the MPL value exceeds the designated objectives Cu, the method 400 ends.
At block 412, a starting interval is defined where the minimum value is equal to the control parameter value with a better performance measurement than the current control parameter value, and the maximum value is equal to the current control parameter value. At block 414, the size of the starting interval is iteratively decreased until a value x is met that satisfies the service level objective for each user load.
At block 416, a determination is made as to whether the value x exists. If the value x exists, process flow resumes at block 418. If the value x does not exist, the method 400 ends. At block 418, a search strategy may be applied that searches within the starting interval or the search interval to identify the lowest control parameter value that satisfies the service level objectives for each user load. The search strategy applied may be a binary search. Process flow then continues to block 308 and block 310 from the method 300 in
At block 419, a function may be determined for each user load that maps the control parameter values to a performance metric. It is important to note that the function may be defined independently of the system state. This ensures that the goal of the function is not to “maximize” system performance but rather to set the control parameters to meet the service level objective. If the system is over-engineered such that it has excess capacity, it may be possible to meet the service level objectives with an underutilized system. If the service level objectives cannot be met when the system is saturated, the method for setting the control parameters will terminate and not push the system beyond capacity.
At block 420, a constant performance metric is determined where the value of the function calculated at each control parameter value is less than said constant performance metric. Process flow then continues to blocks 302, 304, and block 306 from the method 300 in
At block 421, the MPL for one user load whose current control parameter value is not within the operating envelope is increased. At block 422, it is determined if the MPL of each user load lies within the operating envelope. If the MPL of each user load lies within the operating envelope, process flow continues to block 308 from the method 300 in
A high level view or pseudo-code of an algorithm that may be used to implement the method 400 is presented below:
Assume again that throughput can be denoted as the service level objective and that there are two user loads, u1 and u2. The function ƒ is total throughput, and the system is in a steady state while not meeting the objective. For each user load, a suitable control parameter setting that meets the service level objectives of u is located. Then an expansion phase is performed at block 404 (
The result of the expansion phase, performed at block 404 (
If value x does not exist, at block 410 (
The starting interval, determined at block 412 (
for objective 506,
and for objective 508,
The steps shown in
For objective 506, the expansion phase 404 (
For objective 508, the expansion phase 404 (
After the control parameter values have been found for each user load, the isocontour may be defined based on a performance metric for each user load at block 302 (
The isocontours are evaluated using the workload management settings at block 304 (
For each user load that violates their service level objectives such that their control parameters are not within the operating envelope, the control parameter values are optimized at block 420 (
Non-Transitory Machine Readable Medium
The tangible, machine-readable medium 800 may correspond to any storage device that can store computer-executed instructions, such as programming code or the like. For example, the tangible, machine-readable medium 800 may include any combinations of media discussed with respect to the storage 122 shown in
A region 808 of the tangible, machine-readable medium 800 stores machine-readable instructions that, when executed by the processor, define one or more isocontours based on a performance metric for each user load. A region 810 of the tangible, machine-readable medium 800 may store machine-readable instructions that, when executed by the processor, evaluate the isocontours using one or more workload management parameter settings. A region 812 of the tangible, machine-readable medium 800 may store machine-readable instructions that, when executed by the processor, calculate an operating envelope by correlating the isocontours of multiple user loads. A region 814 of the tangible, machine-readable medium 800 may store machine-readable instructions that, when executed by the processor, send a message to a workload manager, wherein the message comprises workload management parameter settings.