Multi-tenant memory quota sharing method based on memory upper limit range in cloud database
By adopting a multi-tenant memory quota sharing method based on the memory upper limit interval in the cloud database, predicting the peak upper limit interval of tenant memory occupancy and implementing corresponding memory sharing strategies, the problem of lack of effective memory resource management and sharing in the existing technology is solved, and efficient resource utilization and tenant performance indicators are achieved.
Patent Information
- Application Number
- CN202310022836.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-08
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-01-08
AI Technical Summary
There is a lack of effective management and sharing methods for tenant memory resources in the multi-tenant database resource management technology in existing cloud databases, which makes it difficult to achieve high resource utilization and tenant performance indicators.
The multi-tenant memory quota sharing method based on the memory upper limit interval is adopted. By obtaining the performance metrics and historical load information of each tenant, the tenant's future memory footprint peak interval is predicted, and different memory sharing strategies are implemented according to different intervals.
It realizes flexible management and sharing of memory resources, adapts to changing workload requirements, ensures resource and performance isolation for multiple tenants, and supports more tenants, thereby improving cost-effectiveness.
Smart Images

Figure CN116302482B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of multi-tenant database resource management in cloud databases, and in particular to multi-tenant database memory resource management and sharing technology. Background Art
[0002] Cloud computing requires better sharing of hardware and software resources among multiple users, and different users can perform personalized configurations without affecting other users. The core principle of multi-tenant cloud computing. Cloud database is an important infrastructure for cloud computing. In a multi-tenant cloud database, multiple databases from different tenants share computing resources provided by the cloud environment, including CPU, memory, and disk resources. Effective resource management plays a vital role in achieving high availability, good performance, scalability, and efficiency in multi-tenant cloud data services. In resource management technology, it is important to have a good estimate of the resources required for database load or query jobs, and this data is needed to guide resource sharing and scheduling. Achieving high resource utilization in a multi-tenant cloud database system while meeting the performance indicators preset by tenants for workloads is an important and challenging problem.
[0003] The literature (Tang, C., Wang, B., Luo, Z., Wu, H., Dasan, S., Fu, M.,... Mishra, P. (2021, October). Forecasting SQL query cost at Twitter. In 2021 IEEE International Conference on Cloud Engineering (IC2E) (pp. 154-160). IEEE.) proposes a SQL query cost prediction service that uses machine learning techniques to train models from historical query request logs and quickly predicts the CPU and memory resource usage of online queries without any calculations in the SQL engine. At Twitter, infrastructure engineers are maintaining a large-scale SQL federation system in local and cloud data centers to serve ad hoc queries. The proposed service can help improve query scheduling by alleviating the problem of imbalanced online analytical processing (OLAP) workloads in SQL engine clusters. It can also help achieve preemptive scaling. In addition, the proposed method uses simple SQL statements for model training and online prediction, which can be generalized to a wider range of SQL systems and heterogeneous environments.
[0004] The paper (Tan Zilong, and Shivnath Babu. "Tempo: robust and self-tuning resource management in multi-tenant parallel databases." arXiv preprint arXiv:1512.00757 (2015).) proposes a framework called Tempo, which optimizes simplicity, self-tuning, and robustness for existing resource management technologies. First, Tempo provides a simple interface for database administrators to specify service level objectives in a declarative manner. Second, Tempo continuously monitors the service level objective compliance in the database and adaptively optimizes the resource manager configuration settings to maximize the service level objective compliance. Robustness is achieved by continuously monitoring quantitative indicators and recovering new system configurations in case the currently applied indicators do not fully reflect the previously recorded indicators. However, Tempo can currently only provide self-tuning services for specific resource managers and does not have a unified and complete interface; and Tempo cannot provide fine-grained service level objective support for tenants' workloads.
[0005] The paper (Das, S., Narasayya, VR, Li, F., Syamala, M. (2013). CPU sharing techniques for performance isolation in multi-tenant relational database-as-a-service. Proceedings of the VLDB Endowment, 7(1), 37-48.) addresses the problem of effective CPU sharing among tenants located on a multi-tenant cloud server. The paper proposes the concept of CPU reservation, which provides tenants with an absolute guarantee of resources without restricting the tenant's workload in any form or manner. The paper proposes two variants of the CPU reservation model, one is static reservation and the other is elastic reservation, which target tenants with very different resource and performance requirements. The paper also proposes a measurement logic to establish the responsibility of the provider. Finally, the paper implements a single scheduling algorithm that is flexible enough to satisfy reservations and provide fine-grained control over resources while satisfying various tenant workloads and provider-enforced policies. However, while this method of sharing CPU reduces system cost, it also reduces system performance. Summary of the invention
[0006] Technical issues to be solved
[0007] In order to make up for the fact that there is no management method and sharing method for tenant memory resources in the current multi-tenant database resource management technology in cloud databases, the present invention provides a multi-tenant memory quota sharing method based on memory upper limit interval in cloud databases. The method first needs to obtain the performance indicators of each tenant and monitor the historical load information of each tenant, and then use the above data to predict the upper limit interval of the tenant's future memory occupancy peak. For tenants falling into different intervals, different memory sharing strategies are executed, thereby realizing the management and sharing of memory resources and supporting more tenants.
[0008] Technical Solution
[0009] A multi-tenant memory quota sharing method based on a memory upper limit interval in a cloud database, characterized by comprising the following steps:
[0010] Step 1: Preset indicators and load statistics:
[0011] (1) defining a resource pool for integrating memory resources that can be allocated to tenants in all multi-tenant databases; the resource pool uses an index to organize all available memory block first address pointers, and the pointers are arranged in descending order according to their memory block sizes in the index; and then allocating a predetermined quota of memory to each tenant;
[0012] (2) Define a readable and writable data file so that tenants can preset performance indicators in a directly specified manner; the performance indicators refer to the performance parameters determined by the user in the service agreement, such as task response time, task deadline, system throughput, resource utilization, etc. This method can provide a basic guarantee for achieving the performance indicators of each tenant in a multi-tenant database, and this method takes maximizing the satisfaction of the indicators as the basic requirement;
[0013] (3) Determine a data collection time interval. At the beginning of each time interval, collect the memory usage of each tenant at that time, including data such as memory usage and memory quota remaining; store the data separately by tenant, where each tenant stores the above data in chronological order;
[0014] Step 2: Prediction of tenant memory upper limit distribution range:
[0015] (1) In the above step 1, the statistical information of the tenant's historical load is used as the input of the memory upper limit interval prediction model; the present invention supports the replacement of the prediction model, and the user can independently select the prediction model;
[0016] (2) The database's satisfaction of each tenant's preset indicators is used as a penalty function for the memory upper limit interval prediction model to control the prediction accuracy;
[0017] (3) Using the load information and performance indicators, the output of the memory upper limit interval prediction model is the peak upper limit interval of the tenant's future memory usage; the upper limit interval is defined as the numerical interval into which the peak memory usage of a tenant is estimated to fall;
[0018] Step 3: Execute the tenant memory sharing policy:
[0019] (1) Each tenant in the multi-tenant database executes different memory sharing strategies based on the above-mentioned predicted memory range; memory sharing is defined as: a tenant shares part of its reserved quota memory resources that are not currently used with other tenants;
[0020] (2) It must be ensured that the free memory shared by tenants will not be used by the tenant in the future, that is, it must not cause the tenant's own performance indicators to decline;
[0021] (3) The lower the value of the tenant's estimated memory upper limit interval is, the more free memory the tenant has available for sharing. The present invention adopts different memory sharing methods for different tenants according to their memory upper limit interval values.
[0022] Step 4: At the end of each current time interval, the load information in this interval is updated into the historical load data, and the upper memory limit interval of each tenant in the next time interval is predicted, and different memory sharing methods are executed according to the interval.
[0023] Beneficial Effects
[0024] The present invention provides a multi-tenant memory quota sharing method based on memory upper limit intervals in a cloud database, which can predict the tenant's memory occupancy peak upper limit interval without making any assumptions about the workload, and perform different memory sharing according to different intervals; the memory resource management method of the present invention is flexible and can adapt to changing workload requirements; the present invention absolutely guarantees the resource and performance isolation of multiple tenants, that is, although other tenants use the shared resources of a tenant, it will not affect the performance indicators of the tenant; further, more tenants can be supported in the cloud database, thereby improving cost-effectiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0026] Figure 1 It is a flow chart of a multi-tenant memory quota sharing method based on a memory upper limit interval in a cloud database of the present invention.
[0027] Figure 2 It is a schematic diagram of performance indicators.
[0028] Figure 3 This is a schematic diagram of multi-tenant load in a cloud environment.
[0029] Figure 4 It is a memory upper limit interval prediction flow chart. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0031] Reference Figure 1 The present invention provides a multi-tenant memory quota sharing method based on a memory upper limit interval in a cloud database, and the specific steps are as follows:
[0032] Step 1: Preset indicators and load statistics.
[0033] Reference Figure 2 . The present invention requires tenants to first specify four categories of preset indicators. The first category, by specifying the task deadline, specifies the time point at which the tenant's task must be completed. It is generally an absolute time, such as 17:00 in the afternoon. For periodic tasks, it is usually the start of the next task run. The measure of the quality of this indicator is defined as the number of jobs that the tenant has not completed by the deadline. The second category, specifies that the task response time must be less than a given threshold. The response time is defined as the average time for the tenant to execute all job tasks. The third category specifies fair memory allocation for tenants to ensure that each tenant obtains a fair allocation of memory. When the database is in a competitive state, the proportion of memory allocated to each tenant must also meet the predetermined value to prevent a single tenant from occupying too much and monopolizing memory resources. This indicator is measured using the ratio between the actual amount of memory used by a tenant and the predetermined quota. The fourth category specifies that memory utilization and throughput must be higher than the threshold to maximize cost-effectiveness. The quality of memory utilization can be measured as the fraction of memory resources allocated to tenants in a time interval to total resources, represented by a ratio between 0 and 1. Throughput is measured using the number of jobs submitted and completed in the time interval. The four categories of indicators are measured according to Figure 2 The priority increases from top to bottom. When available resources cannot meet all indicators, higher priority indicators are given priority.
[0034] Reference Figure 3 The present invention fully supports a wide range of SQL query operations and does not restrict the workload of tenants. The present invention does not make any assumptions about the workload (such as memory residency) and does not require prior knowledge of the workload. In a multi-tenant database, tenants have different loads, and the present invention fully considers various different loads. Figure 3 The actual statistical results of different tenants, such as tenant 1, whose load changes periodically, tenant 2, whose load surges within a certain time interval, and tenant n, whose load increases over time. For load statistics, at the beginning of each time interval, the memory usage of each tenant at that time is collected, including data such as memory usage and memory quota remaining; the data is stored separately by tenant, and each tenant stores the above data in chronological order.
[0035] Step 2: Predict the tenant memory upper limit distribution range.
[0036] Considering the dynamic diversity and suddenness of the load, it takes a long time to accurately predict the memory demand at each moment, and the accuracy is difficult to guarantee. For memory resource scheduling, accurate values are not required, only the prediction of whether the tenant load requires low memory consumption, medium memory consumption or high memory consumption is required. Due to the current situation of such multi-tenant memory scheduling, the present invention replaces the accurately predicted memory value with an approximate range, and applies it to the field of memory resource management technology in a pioneering way.
[0037] Reference Figure 4 . Collect data on the load of each tenant and write it into the request log file as the input for prediction. The load information in the log file includes the unique identifier, tenant name, user ID, memory usage, query statements, etc. Use machine learning technology for training to train a memory machine learning model from the memory history log. Then divide the memory interval, starting from 0, to the size of the entire memory resource pool, and divide it into n intervals equally. After that, extract the features for each load to be predicted. Train the classifier on the data set and predict and classify based on the load features. The number of classifications is the number of divided memory peak intervals. As time goes by and the load changes, new features will appear to affect the classification accuracy. When the classification accuracy is observed to decrease, thereby greatly affecting the tenant performance indicators, the model needs to be trained again.
[0038] Step 3: Execute the tenant memory sharing policy.
[0039] Each tenant in the multi-tenant database executes different memory sharing strategies according to the above-mentioned predicted memory interval. The resource pool is composed of the remaining memory blocks that are not used by all tenants, and is organized from large to small by memory pointers. A tenant with a smaller memory peak upper limit interval indicates that the tenant has more free memory resources available for sharing with other tenants, and at the same time requires fewer memory resources to meet the performance indicators of this tenant. Therefore, when the tenant needs to schedule memory usage, it starts to search sequentially from the later position of the resource pool index until it finds a memory block that meets its own needs; a tenant with a larger memory peak upper limit interval indicates that the tenant has fewer free memory resources available for sharing with other tenants, and at the same time requires more memory resources to meet the performance indicators of this tenant. Therefore, when the tenant needs to schedule memory usage, it starts to search sequentially from the earlier position of the resource pool index until it finds a memory block that meets its own needs. The present invention allocates memory resources to each tenant from the memory pool according to the above-mentioned weights according to each tenant's own upper limit interval.
[0040] Step 4: At the beginning of each time interval, update the load statistics and repeat steps 2 and 3.
[0041] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be included in the protection scope of the present invention.
Claims
1. A multi-tenant memory quota sharing method based on memory upper limit interval in a cloud database, characterized in that Here are the steps: Step 1: Preset indicators and load statistics: (1) defining a resource pool for integrating memory resources that can be allocated to tenants in all multi-tenant databases; the resource pool uses an index to organize all available memory block first address pointers, and the pointers are arranged in descending order according to their memory block sizes in the index; and then allocating a predetermined quota of memory to each tenant; (2) defining a readable and writable data file so that tenants can preset performance indicators in a directly specified manner; the performance indicators refer to the performance parameters determined by the user in the service agreement, and the performance parameters include task response time, task deadline, system throughput, and resource utilization; (3) Determine a data collection time interval. At the beginning of each time interval, collect the memory usage of each tenant at that time, including the memory usage and the remaining amount of memory quota; store the data separately by tenant, wherein each tenant stores the above data in chronological order; Step 2: Predict the tenant memory upper limit distribution range: (1) The statistical information of tenant historical load in the above step 1 is used as the input of the memory upper limit interval prediction model; (2) The database's satisfaction of each tenant's preset indicators is used as a penalty function for the memory upper limit interval prediction model to control the prediction accuracy; (3) Using load information and performance indicators, the output of the memory upper limit interval prediction model is the peak upper limit interval of the tenant's future memory usage; The upper limit interval is defined as the numerical range within which the peak memory usage of a tenant is estimated to fall; Step 3: Execute tenant memory sharing policy: (1) Each tenant in the multi-tenant database executes a different memory sharing strategy based on the predicted memory range. Memory sharing is defined as: a tenant shares the unused portion of its reserved quota memory resources with other tenants; (2) It must be ensured that the free memory shared by tenants will not be used by the tenant in the future, that is, it must not cause the tenant's own performance indicators to decline; (3) The lower the value of the tenant's estimated memory upper limit interval, the more free memory the tenant has available for sharing. Different memory sharing methods are used for different tenants according to their memory upper limit interval values. Step 4: At the end of each current time interval, the load information in this interval is updated into the historical load data, and the upper memory limit interval of each tenant in the next time interval is predicted, and different memory sharing methods are executed according to the interval.
2. A computer system, characterized in that include: One or more processors, and a computer-readable storage medium for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method of claim 1.
3. A computer-readable storage medium, characterized in that Computer executable instructions are stored, and when the instructions are executed, they are used to implement the method of claim 1.
Citation Information
Patent Citations
Resource allocation method for performance consistency of multi-tenant virtual machines in cloud computing environment
CN111580934A
Multi-tenant cloud service management method and device, equipment and storage medium
CN115348264A