Tagged articles
16 articles
Page 1 of 1
Liangxu Linux
Liangxu Linux
May 14, 2025 · Fundamentals

Can TCP and UDP Share the Same Port? A Deep Dive into Port Mechanics

This article breaks down the interview question "Can TCP and UDP use the same port?" by examining protocol-level port spaces, client‑side TCP and UDP port sharing rules, server‑side TCP reuse with SO_REUSEADDR, and UDP reuse with SO_REUSEPORT, complete with code examples and practical implications.

Network programmingPort SharingSO_REUSEADDR
0 likes · 17 min read
Can TCP and UDP Share the Same Port? A Deep Dive into Port Mechanics
Liangxu Linux
Liangxu Linux
Aug 18, 2024 · Backend Development

Why Does the Thundering Herd Problem Still Appear with epoll? Deep Dive and Fixes

This article explains the thundering herd phenomenon in multi‑process/thread servers, details its performance costs, demonstrates the issue with accept() and epoll_wait() through C examples, explores thread‑level herd, and presents mitigation techniques such as accept mutexes, SO_REUSEPORT, and Nginx's handling.

Linux kernelSO_REUSEPORTaccept
0 likes · 20 min read
Why Does the Thundering Herd Problem Still Appear with epoll? Deep Dive and Fixes
Open Source Linux
Open Source Linux
Jun 18, 2024 · Backend Development

Understanding and Solving the Linux Thundering Herd Problem

This article explains the Linux thundering herd phenomenon, its impact on processes, threads, and epoll, demonstrates it with C code examples, analyzes system overhead, and presents mitigation techniques such as accept mutex, SO_REUSEPORT, and proper locking to improve server performance.

LinuxSO_REUSEPORTaccept
0 likes · 19 min read
Understanding and Solving the Linux Thundering Herd Problem
Liangxu Linux
Liangxu Linux
Oct 21, 2023 · Backend Development

Why Nginx Doesn’t Fall Victim to the Thundering Herd Problem

This article explains the thundering herd phenomenon in multi‑process servers, walks through Nginx’s master‑worker architecture and its use of epoll, and compares three practical mitigation techniques—accept_mutex, EPOLLEXCLUSIVE, and SO_REUSEPORT—complete with code excerpts and configuration examples.

BackendNginxSO_REUSEPORT
0 likes · 9 min read
Why Nginx Doesn’t Fall Victim to the Thundering Herd Problem
Liangxu Linux
Liangxu Linux
Sep 30, 2023 · Backend Development

How Nginx Tackles the Thundering Herd Problem with epoll and Advanced Locks

This article explains the thundering herd phenomenon in multi‑process servers, examines Nginx’s master‑worker architecture, and details three mitigation techniques—accept_mutex, EPOLLEXCLUSIVE, and SO_REUSEPORT—showing how each leverages epoll and kernel features to reduce unnecessary wake‑ups.

SO_REUSEPORTaccept_mutexepoll
0 likes · 9 min read
How Nginx Tackles the Thundering Herd Problem with epoll and Advanced Locks
Liangxu Linux
Liangxu Linux
Mar 2, 2022 · Backend Development

Unlocking Linux SO_REUSEPORT: How Multiple Processes Can Share the Same Port

Linux kernels 3.9+ introduce the SO_REUSEPORT option, allowing multiple processes to bind and listen on the same port, with the kernel handling load‑balancing and security checks; this article explains the problem it solves, the underlying implementation, and provides practical C examples and verification steps.

CSO_REUSEPORTload balancing
0 likes · 16 min read
Unlocking Linux SO_REUSEPORT: How Multiple Processes Can Share the Same Port
ITPUB
ITPUB
Feb 21, 2022 · Backend Development

Unlocking Multi‑Process Server Speed: How Linux REUSEPORT Works

This article explains why Linux kernels 3.9+ allow multiple processes to bind the same port, how the REUSEPORT option implements kernel‑level load balancing, and provides step‑by‑step examples showing configuration, code snippets, and performance verification.

BackendLinuxSO_REUSEPORT
0 likes · 14 min read
Unlocking Multi‑Process Server Speed: How Linux REUSEPORT Works
Qu Tech
Qu Tech
Jan 25, 2021 · Operations

How to Diagnose and Fix High Load with Low CPU Utilization in Nginx

This article walks through Linux process states, fork/exec creation, CPU vs load metrics, network I/O models, and a real‑world Nginx high‑load case, showing how strace, accept_mutex, and SO_REUSEPORT can resolve the issue.

Linux performanceNginxSO_REUSEPORT
0 likes · 12 min read
How to Diagnose and Fix High Load with Low CPU Utilization in Nginx
Liangxu Linux
Liangxu Linux
Jan 17, 2021 · Fundamentals

When Do SO_REUSEADDR and SO_REUSEPORT Actually Take Effect? A Deep Dive

This article explains the differences and interactions between the SO_REUSEADDR and SO_REUSEPORT socket options, shows how they behave on BSD and Linux kernels across versions, and provides code examples and tables to illustrate binding rules, TIME_WAIT handling, and the evolution of reuse‑port support.

Linux kernelSO_REUSEADDRSO_REUSEPORT
0 likes · 14 min read
When Do SO_REUSEADDR and SO_REUSEPORT Actually Take Effect? A Deep Dive
21CTO
21CTO
Mar 5, 2016 · Backend Development

How SO_REUSEPORT Boosts NGINX Performance and Enables Seamless Rolling Upgrades

NGINX 1.9.1 adds the SO_REUSEPORT socket option, allowing multiple workers to share the same IP and port, which the kernel load‑balances, reducing lock contention and dramatically improving request throughput and latency in multi‑core environments.

SO_REUSEPORTload balancingperformance tuning
0 likes · 6 min read
How SO_REUSEPORT Boosts NGINX Performance and Enables Seamless Rolling Upgrades