Search

US-12619355-B2 - Machine learning database memory use prediction and adaptation

US12619355B2US 12619355 B2US12619355 B2US 12619355B2US-12619355-B2

Abstract

Methods, systems, and computer-readable storage media for machine learning database memory use prediction and adaptation. An example method includes determining a sampling interval for an application for sampling memory use by a database for the application. A plurality of historical memory use samples of amounts of memory used by the database are determined for the application based on the sampling interval. The plurality of historical memory use samples are provided for training of a machine learning model to predict memory use for the application by the database for a future time period. A set of current memory use samples are provided to the machine learning model and a memory use prediction for the application for an upcoming time period is received from the machine learning model. A determination is made as to whether to extend memory of the database for the application based on the memory use prediction.

Inventors

  • Xiaotao Wang
  • Jing He

Assignees

  • SAP SE

Dates

Publication Date
20260505
Application Date
20220519

Claims (17)

  1. 1 . A computer-implemented method for machine learning database memory use prediction and adaptation, comprising: determining a sampling interval for an application for sampling memory use by a database for the application; determining a plurality of historical memory use samples of amounts of memory used by the database for the application based on the sampling interval; providing the plurality of historical memory use samples for training of a machine learning model to predict memory use for the application by the database for a future time period; determining, based on the sampling interval and a predefined prediction accuracy level, a machine learning model retraining interval; determining a set of current memory use samples for the application; providing the set of current memory use samples for the application to the machine learning model; receiving a memory use prediction for the application for an upcoming time period from the machine learning model; determining whether to extend memory of the database for the application based on the memory use prediction received from the machine learning model; determining an actual memory use for the application that occurs in the upcoming time period; comparing the actual memory use to the memory use prediction to generate a prediction result for the upcoming time period; and retraining the machine learning model, using the prediction result and after the machine learning model retraining interval has elapsed, to maintain a prediction accuracy of the machine learning model at least at the predefined prediction accuracy level.
  2. 2 . The computer-implemented method of claim 1 , wherein determining whether to extend memory of the database for the application comprises: determining a memory use threshold by the database for the application for the upcoming time period; comparing the memory use prediction to the memory use threshold; determining to extend the memory of the database in response to the memory use prediction at least meeting the memory use threshold; and determining to not extend the memory of the database in response to the memory use prediction not meeting the memory use threshold.
  3. 3 . The computer-implemented method of claim 1 , wherein the sampling interval is based on a processing cycle of the application.
  4. 4 . The computer-implemented method of claim 3 , wherein a longer processing cycle results in a longer sampling interval and a shorter processing cycle results in a shorter sampling interval.
  5. 5 . The computer-implemented method of claim 1 , wherein the historical memory use samples and the current memory use samples are obtained by querying a system table of the database.
  6. 6 . The computer-implemented method of claim 1 , wherein the machine learning model is a long short term memory (LSTM) model.
  7. 7 . A non-transitory computer-readable storage medium coupled to one or more processors and having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations for machine learning database memory use prediction and adaptation, the operations comprising: determining a sampling interval for an application for sampling memory use by a database for the application; determining a plurality of historical memory use samples of amounts of memory used by the database for the application based on the sampling interval; providing the plurality of historical memory use samples for training of a machine learning model to predict memory use for the application by the database for a future time period; determining, based on the sampling interval and a predefined prediction accuracy level, a machine learning model retraining interval; determining a set of current memory use samples for the application; providing the set of current memory use samples for the application to the machine learning model; receiving a memory use prediction for the application for an upcoming time period from the machine learning model; determining whether to extend memory of the database for the application based on the memory use prediction received from the machine learning model; determining an actual memory use for the application that occurs in the upcoming time period; comparing the actual memory use to the memory use prediction to generate a prediction result for the upcoming time period; and retraining the machine learning model, using the prediction result and after the machine learning model retraining interval has elapsed, to maintain a prediction accuracy of the machine learning model at least at the predefined prediction accuracy level.
  8. 8 . The computer-readable storage medium of claim 7 , wherein determining whether to extend memory of the database for the application comprises: determining a memory use threshold by the database for the application for the upcoming time period; comparing the memory use prediction to the memory use threshold; determining to extend the memory of the database in response to the memory use prediction at least meeting the memory use threshold; and determining to not extend the memory of the database in response to the memory use prediction not meeting the memory use threshold.
  9. 9 . The computer-readable storage medium of claim 7 , wherein the sampling interval is based on a processing cycle of the application.
  10. 10 . The computer-readable storage medium of claim 9 , wherein a longer processing cycle results in a longer sampling interval and a shorter processing cycle results in a shorter sampling interval.
  11. 11 . The computer-readable storage medium of claim 7 , wherein the historical memory use samples and the current memory use samples are obtained by querying a system table of the database.
  12. 12 . The computer-readable storage medium of claim 7 , wherein the machine learning model is a long short term memory (LSTM) model.
  13. 13 . A system, comprising: a computing device; and a computer-readable storage device coupled to the computing device and having instructions stored thereon which, when executed by the computing device, cause the computing device to perform operations for machine learning database memory use prediction and adaptation, the operations comprising: determining a sampling interval for an application for sampling memory use by a database for the application; determining a plurality of historical memory use samples of amounts of memory used by the database for the application based on the sampling interval; providing the plurality of historical memory use samples for training of a machine learning model to predict memory use for the application by the database for a future time period; determining, based on the sampling interval and a predefined prediction accuracy level, a machine learning model retraining interval; determining a set of current memory use samples for the application; providing the set of current memory use samples for the application to the machine learning model; receiving a memory use prediction for the application for an upcoming time period from the machine learning model; determining whether to extend memory of the database for the application based on the memory use prediction received from the machine learning model; determining an actual memory use for the application that occurs in the upcoming time period; comparing the actual memory use to the memory use prediction to generate a prediction result for the upcoming time period; and retraining the machine learning model, using the prediction result and after the machine learning model retraining interval has elapsed, to maintain a prediction accuracy of the machine learning model at least at the predefined prediction accuracy level.
  14. 14 . The system of claim 13 , wherein determining whether to extend memory of the database for the application comprises: determining a memory use threshold by the database for the application for the upcoming time period; comparing the memory use prediction to the memory use threshold; determining to extend the memory of the database in response to the memory use prediction at least meeting the memory use threshold; and determining to not extend the memory of the database in response to the memory use prediction not meeting the memory use threshold.
  15. 15 . The system of claim 13 , wherein the sampling interval is based on a processing cycle of the application.
  16. 16 . The system of claim 15 , wherein a longer processing cycle results in a longer sampling interval and a shorter processing cycle results in a shorter sampling interval.
  17. 17 . The system of claim 13 , wherein the historical memory use samples and the current memory use samples are obtained by querying a system table of the database.

Description

BACKGROUND Database performance, such as for in-memory databases and other types of database, can be affected by an amount of configured memory made available to the database. Depending on application loads, memory usage by a database can fluctuate over different time periods. For some applications, application changes may cause an increase in demand for memory as compared to prior application versions. SUMMARY Implementations of the present disclosure are directed to machine learning database memory use prediction and adaptation. In some implementations, actions include: determining a sampling interval for an application for sampling memory use by a database for the application; determining a plurality of historical memory use samples of amounts of memory used by the database for the application based on the sampling interval; providing the plurality of historical memory use samples for training of a machine learning model to predict memory use for the application by the database for a future time period; determining a set of current memory use samples for the application; providing the set of current memory use samples for the application to the machine learning model; receiving a memory use prediction for the application for an upcoming time period from the machine learning model; and determining whether to extend memory of the database for the application based on the memory use prediction received from the machine learning model. Other implementations of this aspect include corresponding systems, apparatus, and computer programs, configured to perform the actions of the methods, encoded on computer storage devices. These and other implementations can each optionally include one or more of the following features. Determining whether to extend memory of the database for the application can include: determining a memory use threshold by the database for the application for the upcoming time period; comparing the memory use prediction to the memory use threshold; determining to extend the memory of the database in response to the memory use prediction at least meeting the memory use threshold; and determining to not extend the memory of the database in response to the memory use prediction not meeting the memory use threshold. The sampling interval can be based on a processing cycle of the application. A longer processing cycle can result in a longer sampling interval and a shorter processing cycle can result in a shorter sampling interval. The historical memory use samples and the current memory use samples can be obtained by querying a system table of the database. An actual memory use that occurs in the upcoming time period can be determined. The actual memory use can be compared to the memory use prediction to generate a prediction result for the upcoming time period and the prediction result can be used in a feedback loop to update the machine learning model. The machine learning model can be a Long Short Term Memory (LSTM) model. The present disclosure also provides a computer-readable storage medium coupled to one or more processors and having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations in accordance with implementations of the methods provided herein. The present disclosure further provides a system for implementing the methods provided herein. The system includes one or more processors, and a computer-readable storage medium coupled to the one or more processors having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations in accordance with implementations of the methods provided herein. It is appreciated that methods in accordance with the present disclosure can include any combination of the aspects and features described herein. That is, methods in accordance with the present disclosure are not limited to the combinations of aspects and features specifically described herein, but also include any combination of the aspects and features provided. The details of one or more implementations of the present disclosure are set forth in the accompanying drawings and the description below. Other features and advantages of the present disclosure will be apparent from the description and drawings, and from the claims. DESCRIPTION OF DRAWINGS FIG. 1 depicts an example architecture that can be used to execute implementations of the present disclosure. FIG. 2 depicts an example process that can be executed in accordance with implementations of the present disclosure. FIG. 3 depicts an example conceptual architecture in accordance with implementations of the present disclosure. FIG. 4 is a diagram that illustrates example tables. FIG. 5 illustrates an example graph of predicted and actual memory usage values. FIG. 6 depicts an example process that can be executed in accordance with implementations of the present disclosure. FIG. 7 is a sch