Low Watermark Buffer Cache Memory Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In-memory databases face challenges in efficiently managing memory due to increasing data processing demands, which can lead to memory limitations and decreased performance.
Innovation Solution
A method is implemented to configure a threshold for page-loadable data in a buffer cache, monitoring usage, and triggering a background job to release buffers when usage exceeds a set low watermark threshold, while ensuring ongoing database operations can continue.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If all required data is loaded into memory for in-memory operations, then query execution speed is improved, but memory limitations are exceeded and system performance deteriorates
Solution Approach 1:
The patent segments the buffer cache into multiple pools (hot buffer pool, warm buffer pool, cold buffer pool) based on data access frequency and recency. This segmentation allows the system to manage different portions of data differently, keeping frequently accessed data in memory while allowing less frequently accessed data to be paged out, thus resolving the contradiction between query speed and memory capacity
Solution Approach 2:
The patent dynamically changes the state of buffer pages by transitioning them between different pools based on access patterns. Pages are promoted from cold to warm to hot pools based on recency and frequency of access, and demoted accordingly. This dynamic parameter change allows the system to adapt memory allocation to actual usage patterns, maintaining performance while managing limited memory resources
2Productivity
If a fixed buffer cache size is allocated, then memory management is simplified, but the system cannot adapt to varying data access patterns and performance degrades
Solution Approach 1:
The patent implements a dynamic buffer cache management system where the allocation and state of buffer pages change based on access patterns. The system continuously monitors data access and dynamically promotes or demotes pages between hot, warm, and cold pools, allowing the buffer cache to adapt to varying data access patterns and maintain optimal performance
Solution Approach 2:
The system employs self-service mechanisms through automatic page promotion and demotion based on access patterns. The buffer pool manager automatically manages the lifecycle of buffer pages, promoting frequently accessed pages to hot pools and demoting infrequently accessed pages to cold pools or evicting them, without requiring manual intervention while maintaining system performance
3Quantity of substance
If buffers are released frequently to manage memory usage, then memory overflow is prevented, but database operation performance deteriorates due to continuous paging
Solution Approach 1:
The patent performs preliminary actions by pre-loading data into the buffer cache before it is actually needed for query execution. The system proactively manages buffer allocation and pre-fetches data based on predicted access patterns, ensuring that frequently needed data is already in memory when queries are executed, thus preventing memory overflow while maintaining operation throughput
Solution Approach 2:
The system maintains continuity of useful action by keeping hot and warm buffer pools continuously populated with frequently accessed data. This ensures that database operations can continue without interruption from paging, as the necessary data remains in memory throughout the operation, while still managing overall memory usage through the cold pool eviction mechanism
Data Source
AI summary
In some implementations, there is provided a method that includes configuring a first threshold for page-loadable data at a buffer cache associated with a database; checking the buffer cache to determine usage of the buffer cache by the page-loadable data; in response to the usage of the buffer cache being more than the first threshold, causing a background job to release one or more buffers in the buffer cache; checking, after releasing at least one buffer of the buffer cache, the buffer cache to determine whether usage by the page-loadable data is below the first threshold; in response to the usage being below the first threshold, stopping the release of additional one or more buffers in the buffer cache; and in response to the usage being above the first threshold, continuing the release of the additional one or more buffers in the buffer cache.


