Industry Insights 17 min read

Why Tencent’s F-Stack Is Redefining High‑Performance Network Services

The article examines the evolution of Tencent Cloud’s F-Stack—a full user‑space networking framework built on DPDK, FreeBSD, and micro‑threading—detailing its architecture, supported versions, POSIX‑compatible API, real‑world deployments such as HttpDNS and DNSPod, performance gains over kernel stacks, and the roadmap for future enhancements.

Tencent Cloud Developer
Tencent Cloud Developer
Tencent Cloud Developer
Why Tencent’s F-Stack Is Redefining High‑Performance Network Services

Background and Motivation

Over the past decades, explosive internet growth and frequent DDoS attacks have pushed network performance to its limits. While bandwidth and hardware have continuously improved, software performance lagged, forcing many services to rely on massive server farms, leading to resource waste and higher costs.

Multithreading and event‑driven models (kqueue/epoll) solved the C10K problem in the early 2000s, but the second decade of the 21st century brought traffic volumes that exceeded those solutions, creating a need for new approaches.

Why Kernel Bypass?

High‑traffic services such as Tencent Cloud’s HttpDNS experience request volumes that double every few months, demanding a high‑performance network stack. Traditional kernel TCP stacks cap out at under 100k QPS per instance, while techniques like REUSEPORT raise the ceiling to several hundred thousand QPS but still face horizontal scaling bottlenecks. Bypassing the kernel with DPDK and a user‑space protocol stack eliminates these limits.

F‑Stack Overview

F‑Stack is a full user‑space networking development kit that combines DPDK for fast packet I/O, the FreeBSD network stack, and a micro‑thread interface. Developers focus on business logic while F‑Stack handles high‑performance networking. Because the kernel stack is bypassed, the framework is unsuitable for protocols below layer 4 or complex UDP‑based applications, but it fully supports TCP‑based services.

Key Technical Features

Multi‑process Architecture : Each process is bound to a CPU core and a NIC queue, providing cache locality and eliminating locks, context switches, and scheduler overhead.

DPDK Integration : Initially built on DPDK 16.07, F‑Stack now tracks the latest LTS releases (e.g., 18.11.x, 19.11.x) and supports development branches up to 20.11.x.

FreeBSD User‑Space Stack : Offers a complete protocol suite with familiar debugging tools (sysctl, netstat, etc.) and benefits from clear, maintainable code compared to Linux’s complex stack.

POSIX‑like API : Functions prefixed with ff_ (e.g., ff_socket, ff_bind) mirror standard Linux calls, allowing straightforward porting of existing applications. An ff_epoll wrapper provides compatibility with Linux’s epoll semantics.

Micro‑thread Framework : Built on Tencent’s open‑source micro_thread library, it enables synchronous‑style programming on top of the asynchronous core. The micro‑thread module is GPL‑2.0, separate from F‑Stack’s BSD‑2‑Clause license.

Application Migration

F‑Stack is distributed as a library that must be linked with the target application. It already provides ready‑made ports for Nginx and Redis. For multi‑threaded applications that share resources, developers are encouraged to reduce shared state to maximize performance; otherwise, a separate I/O module may be introduced at the cost of some overhead.

Real‑World Deployments

HttpDNS : A mobile‑focused DNS service that handles trillions of daily requests. By moving to F‑Stack, HttpDNS achieved a ten‑fold performance increase, especially for short‑connection TCP workloads on more than 12 cores.

DNSPod Authoritative DNS : Serves tens of millions of domains with single‑node throughput exceeding 100 M QPS on 100 G machines, thanks to F‑Stack’s high‑throughput networking.

Performance Comparison

Benchmarks comparing Nginx on the kernel stack versus on F‑Stack show significant latency and throughput improvements for both short‑ and long‑lived TCP connections, with the most pronounced gains in short‑connection scenarios beyond 12 CPU cores.

Roadmap (F‑Stack 1.22)

Upgrade to DPDK 20.11 (meson/ninja build system).

Support FreeBSD 13.0 (pending stability fixes for BBR/RACK and some tools).

Introduce zero‑copy APIs.

Provide one‑click application migration tools (LD_PRELOAD‑style) with a performance trade‑off.

Add Nginx 1.20 and Redis 6 compatibility.

Other User‑Space Stacks

VPP – Cisco‑led, highly active community.

MTCP – Korean KAIST project, TCP‑only.

Seastar – ScyllaDB’s native stack, suited for internal networks.

LwIP – Lightweight stack for embedded systems.

F‑Stack’s open‑source releases (from 2017‑04‑14 to 2021‑01‑29) demonstrate a steady evolution, with each version incorporating newer DPDK releases, FreeBSD updates, and additional features such as zero‑copy interfaces and broader application support.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend Developmenthigh performanceDPDKNetwork StackFreeBSDF-Stackuser-space networking
Tencent Cloud Developer
Written by

Tencent Cloud Developer

Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.