Sockmap-based Local Network Optimization for Redis
Application scenario: Redis has high network overhead in both pipeline and non-pipeline scenarios. Especially in non-pipeline scenarios, the overhead from frequent network packet encapsulation and decapsulation may still exist during local TCP network communication. In local network communication scenarios, technologies such as shared memory are used to avoid redundant calculation of packet encapsulation and decapsulation.
Technical principle: Sockmap implements a kernel-space socket forwarding framework based on the Linux extended Berkeley Packet Filter (eBPF) technology. It enables direct data forwarding between local TCP connections in the kernel by writing sk_buff to the receive queue of the target socket. This reduces data copying and eliminates packet encapsulation and decapsulation for high-performance TCP communication.
Performance metric: Under a configuration of 2 vCPUs and 10 GB memory in local TCP network communication scenarios, the Redis performance is improved by 5% to 50% in redis-benchmark testing.
