Socket Buffer Read Timing for Fewer TCP System Calls
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Excessively frequent system calls in TCP-based network access lead to CPU resource waste and increased power consumption due to inefficient data handling in mobile devices.
Innovation Solution
Implement a data processing method that includes monitoring data buffering in a kernel buffer using a monitoring module with a timer and data readable identifiers to optimize data retrieval, reducing system calls and aligning data transfer with application latency requirements.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If data is stored in a distributed file system across multiple data processing clusters, then data availability and fault tolerance are improved, but data access efficiency deteriorates due to network latency and distributed coordination overhead
Solution Approach 1:
The patent segments data access operations into two distinct pathways: hot data access through a local file system on the same node, and cold data access through the distributed file system over the network. This segmentation allows frequently accessed data to be served locally without network latency, while maintaining distributed storage for fault tolerance. The file system client on each node maintains a local cache of frequently accessed data blocks, enabling fast access for hot data while preserving the reliability benefits of distributed storage.
Solution Approach 2:
The patent introduces a local file system and cache memory on each data processing node as an intermediary layer between the distributed file system and the compute engines. This intermediary local file system acts as a buffer that can serve data requests without network communication when data is available locally, thereby mediating between the distributed storage system and the compute nodes to eliminate network latency for hot data access while maintaining the distributed architecture for reliability.
2Speed
If data is cached in local memory on data processing nodes, then data access speed is improved, but memory usage and data locality requirements worsen
Solution Approach 1:
The patent applies local quality by implementing cache memory with different retention policies and capacities on different data processing nodes based on their specific access patterns. Each node maintains a local cache tailored to its workload characteristics, caching frequently accessed data locally while allowing less frequently accessed data to be stored in the distributed file system. This localized caching strategy optimizes memory usage on each node according to its specific needs rather than applying a uniform caching policy across all nodes.
Solution Approach 2:
The patent implements partial caching where only a subset of data that is frequently accessed (hot data) is cached in local memory on each node, while the remainder of the data remains in the distributed file system. The cache size and eviction policies are configured to maintain only the necessary portion of data in local memory, avoiding excessive memory consumption while still providing fast access for the most commonly accessed data. This partial action approach balances memory usage against access speed requirements.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
This application provides a data processing method and apparatus, and a device. The method includes: receiving, by an operating system of a device, a start instruction that includes an identifier of a socket connection and that is sent by an application in the device, where the application is a latency-insensitive application; calling, by the operating system according to the start instruction, a monitoring module in the operating system to monitor a case about buffering data of the socket connection in a kernel buffer, where the data of the socket connection is from an underlying protocol stack; and generating, by the monitoring module, a data readable identifier when a time interval between a current moment and a start moment is greater than or equal to timeout duration, where the start moment is a moment at which the operating system receives the start instruction, and the data readable identifier indicates that the data of the socket connection received in the kernel buffer is readable by the application. In this way, a data buffering process is optimized through time restriction, and a process in which the application receives data from the operating system better meets an actual requirement, thereby reducing a quantity of system calls.