Persistent DNS Hard Cache for JVM Startup Latency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current DNS caching mechanisms in Java are not persistent and rely on runtime memory, leading to caching staleness and increased application startup times due to IP address changes, which can impact performance and availability.
Innovation Solution
Implementing a dynamic DNS caching system that persists cache entries to disk, using a hard cache that persists across JVM reboots and includes a verification phase to update and maintain cache integrity, with soft caches for successful and unsuccessful entries, allowing for periodic verification and updating without requiring a system reboot.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If runtime memory caching is used for DNS entries, then application startup time is reduced, but cache persistence is lost after JVM reboot
Solution Approach 1:
The patent creates a duplicate copy of the DNS cache data structure and persists it to disk storage. The硬缓存 (hard cache) on disk is a copy of the runtime soft cache data that survives JVM reboots, allowing rapid population of new runtime caches without full DNS resolution cycles.
Solution Approach 2:
The system performs preliminary DNS resolution and cache population before the application needs to start. By pre-resolving DNS entries and storing them in the hard cache on disk, the system eliminates the need for time-consuming DNS lookups during application startup.
2Duration of action of stationary object
If DNS cache is persisted to disk, then cache persistence is improved, but verification and update complexity increases
Solution Approach 1:
The patent segments the DNS cache into multiple independent data structures: soft cache for runtime memory, hard cache for persistent disk storage, positive cache for successful resolutions, and negative cache for failed resolutions. Each segment has its own verification and update rules, simplifying the overall management complexity.
Solution Approach 2:
The system implements feedback mechanisms where DNS resolution results are continuously monitored and used to update the cache. The verification phase uses feedback from actual DNS resolution attempts to validate hard cache entries and update the cache structure accordingly, automating the verification process.
3Measurement precision
If hard cache verification is performed frequently, then cache accuracy is improved, but system performance deteriorates
Solution Approach 1:
The patent implements periodic verification of the hard cache at scheduled intervals rather than continuously. The sleep phase between verification cycles allows the system to maintain cache accuracy while avoiding constant performance overhead, balancing accuracy requirements with system productivity.
Solution Approach 2:
The system changes the verification parameter from continuous to periodic by introducing a sleep duration between verification phases. This parameter adjustment reduces the frequency of verification operations, thereby improving system performance while maintaining acceptable cache accuracy through regular updates.
Data Source
AI summary
In one aspect, a system for controlling domain name service (DNS) caching is disclosed, the system includes a processor; a memory; and one or more modules stored in the memory and executable by a processor to perform various operations. The various operations include maintain a hard cache on a local disk that includes a file of DNS entries that persists and available for access by an application after a reboot of a Java Virtual Machine (JVM) system running the application; populate a runtime positive soft cache with the entries from the hard cache, wherein the positive soft cache represents DNS entries assumed to be successful for resolving DNS client calls from the application that persists until the reboot of the JVM system running the application; and load entries into the runtime positive soft cache populated from the hard cache in response to an application making DNS client calls.


