How Tencent’s TGW Architecture Revolutionizes Public Cloud Load Balancing
This article provides an in‑depth technical overview of Tencent Gateway (TGW), detailing its evolution from TGW 1.0 to 2.0, the introduction of Region EIP, the redesign of public CLB, the Shanhai architecture, and future hardware‑offload directions for high‑performance cloud networking.
1. TGW: Public Bridgehead
TGW (Tencent Gateway) is a multi‑network unified access system with automatic load balancing, serving as the company's public‑network bridgehead for over ten years. It connects major carriers, supports public‑cloud EIP and CLB products, and provides public‑network access for services such as games and WeChat.
TGW offers two main products: Elastic EIP and four‑layer CLB (internal and external). CLB can be IPV4 or IPV6, BGP or three‑network, and supports both IPv4/IPv6 and BGP/three‑network configurations.
2. Introduction of Region EIP
Previously, EIP and CLB used separate IP pools, causing isolation and migration issues. Region EIP (REIP) consolidates public‑network exits into one or two core data centers, enabling cross‑AZ disaster recovery and increasing device utilization. A single REIP instance can deliver up to five times the performance of the original EIP, reducing device count from over 3000 to about 700.
3. Evolution of Public CLB
The initial plan was to replace public CLB with a two‑layer model (REIP + internal CLB). However, user experience changes, habit changes, and migration difficulties led to the decision to keep public CLB unchanged while still supporting new REIP‑based traffic.
4. Shanhai Architecture
4.1 Shanhai 1.0
Shanhai 1.0 decouples product shapes from physical cluster types by using only two cluster kinds—REIP and CLB. REIP aggregates all network types into a unified “full‑pass” cluster, while CLB handles both internal and external traffic via tunnels, reducing the minimum server count to eight per region.
Key benefits include transparent product interfaces, precise distributed rate‑limiting, hot migration without traffic interruption, and fine‑grained VIP scheduling.
4.2 Shanhai 2.0
Shanhai 2.0 introduces “drainage switches” to replace dedicated CLB gateway zones, allowing four high‑capacity switches per data center to handle 4‑6 TB of traffic. This reduces rack space, enables flexible server placement, and supports fine‑grained scheduling down to IP + port granularity.
5. Outlook
The next major direction for gateway devices is high‑performance hardware offload using DPUs, switches, and FPGA/ASIC. Stateless devices rely on switches, while stateful processing moves to DPUs. P4 programming lowers development barriers, and smaller‑scale sites are being designed to deliver full functionality with minimal hardware.
Tencent Architect
We share technical insights on storage, computing, and access, and explore industry-leading product technologies together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.