UDP Message Distribution Using eBPF-Isolated Process Groups
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In Nginx-based streaming media servers, during application service upgrades or hot updates, multiple process groups can exist concurrently, leading to disorder in UDP message distribution, causing disruptions in live streaming and affecting service quality due to data being sent to incorrect process groups.
Innovation Solution
Implementing Extended Berkeley Packet Filter (EBPF) resources for each process group to ensure independent management of file descriptors (FDs), ensuring that UDP messages are distributed correctly by determining the appropriate target process group based on the quadruple extracted from the UDP message.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If multiple process groups are used for application services during upgrade or hot update, then service continuity and adaptability are improved, but UDP message distribution reliability deteriorates due to data being sent to incorrect process groups
Solution Approach 1:
The patent segments the file descriptor management by creating independent EBPF resources for each process group. Each process group has its own dedicated file descriptors and socket buffers, preventing cross-contamination of UDP messages between old and new process groups during upgrades. This segmentation ensures that messages are reliably routed to the correct process group while maintaining service continuity.
Solution Approach 2:
The patent introduces an intermediary mechanism (EBPF resource management layer) that sits between the UDP message reception and process group handling. This intermediary maintains a mapping between socket buffers and specific process groups, ensuring messages are correctly routed even when multiple process groups coexist during upgrades, thus resolving the reliability issue while preserving adaptability.
2Reliability
If EBPF resources are allocated for each process group, then UDP message distribution reliability is improved, but device complexity increases due to separate resource management
Solution Approach 1:
The patent creates a universal EBPF resource management framework that handles multiple process groups through a standardized interface. The same EBPF infrastructure and resource allocation mechanisms are reused across all process groups, providing reliable message distribution without proportionally increasing complexity. The system manages file descriptors and socket buffers uniformly for both old and new process groups.
Solution Approach 2:
The patent manages complexity by dynamically allocating EBPF resources based on process group state. When process groups are created or destroyed during upgrades, the system adjusts the number and configuration of EBPF resources accordingly. This parameter-based resource management ensures reliability while adapting the level of complexity to actual operational needs rather than maintaining fixed high complexity.
Data Source
Figure 1~2
Figure 3A~4
Figure 5~6
AI summary
A UDP message distribution method, a UDP message distribution apparatus and a computer readable storage medium are provided according to the present application. In response to there being multiple process groups for one application service concurrently, each of the multiple process groups has an EBPF resource independent from each other, and the EBPF resource is used to store information of an FD of each process in each of the multiple process groups. After a UDP message is received, a server is configured to determine a target process group from multiple process groups of a reuseport group according to a quadruple of the UDP message, select a target FD from the FD of each process of the target process group, and receive and transmit data by using the target FD. In this way, since each of the multiple process groups has an EBPF resource independent from each other, the processes belong to different process groups do not preempt the same FD, which ensures that the UDP message is not distributed in disorder in response to there being multiple process groups for one application service concurrently, thereby ensuring the service quality. Moreover, the problem of performance consumption due to soft interrupt caused by UDP connect can be solved, so that the concurrency capability is high.