Tengine’s Dubbo Support: Architecture, Benefits, and Practical Guide
The article introduces Alibaba's open‑source web server Tengine, explains its Dubbo integration that enables HTTP‑to‑Dubbo proxying, compares it with traditional Java gateway architectures, highlights performance and stability advantages, and provides practical examples and future roadmap details.
Author: Wu Mengqi (aka Han Shu), Alibaba Middleware Technology Expert, core developer of Alibaba Tengine, focusing on Nginx, cloud‑native, and Service Mesh.
What is Tengine
Tengine is Alibaba's open‑source web server built on Nginx, inheriting all Nginx features while adding extensions such as dynamic module loading, layer‑4 load balancing, and reuseport support, many of which have been upstreamed to Nginx.
Since its open‑source release, Tengine has become a popular Nginx alternative (official site: http://tengine.taobao.org/). It is commonly used as a reverse‑proxy entry gateway in many companies.
What is Dubbo
Dubbo is an open‑source RPC framework originally developed by Alibaba, now an Apache project, providing a registry, service governance, and other capabilities (official site: http://dubbo.apache.org/). A typical Dubbo system architecture is shown below.
Traditional Gateway Architecture
Before Tengine supported Dubbo, the typical gateway stack was:
Access‑gateway cluster (Nginx/Tengine) → Business‑gateway cluster (Tomcat or Netty) → Business services exposing Dubbo.
The Java business gateway translates HTTP requests to Dubbo calls and often implements additional functions such as rate‑limiting, authentication, and routing. This architecture faces two major challenges:
Performance – Java‑based gateways cannot match the ultra‑high performance of Nginx‑style servers, leading to high resource costs.
Stability – As a single point of failure in the critical data path, any instability can cause large‑scale outages.
Teams have long been seeking solutions to these problems, and a new approach is introduced below.
Tengine Supports Dubbo
Tengine can act as a Dubbo consumer, directly invoking Dubbo services while functioning as a reverse‑proxy. This enables the following simplified architecture:
With this capability, the HTTP‑to‑RPC conversion previously performed by a Java gateway can be done inside Tengine. Existing business logic can be offloaded to a side‑car control system that pushes configuration and Lua scripts to Tengine, improving resource utilization and moving dependency from the data‑plane Java gateway to a control‑plane system, thereby enhancing stability.
Internally, many Alibaba services already rely on Tengine’s RPC support, such as accessing internal HSF services (a Dubbo‑like framework).
Advantages of Tengine’s Dubbo Feature
The integration offers two main benefits:
1. Architecture Optimization
2. Performance Optimization
Benchmarks show that the Tengine‑Dubbo path reduces CPU usage and latency by 28%‑73% compared with traditional stacks.
Reasons for high performance:
Eliminating an extra forwarding layer by handling Dubbo calls directly at the entry gateway.
Dubbo’s binary, multiplexed protocol is more efficient than text‑based HTTP.
Tengine Dubbo Practical Example
Example projects are available in the Apache Dubbo samples repository and the Tengine source:
https://github.com/apache/dubbo-samples/blob/master/java/dubbo-samples-tengine/README.md
https://github.com/alibaba/tengine/blob/master/modules/mod_dubbo/README.md
The demo demonstrates the following flow:
User tengine (dubbo_pass) Dubbo Service Provider
| |
|--- GET github.com:443 -->| |
| |--- Dubbo Multiplexing Binary RPC Request -->|
| | |
| |<-- Dubbo Multiplexing Binary RPC Response ---|
|<-- HTTP/1.1 200 ---|Feel free to clone the examples and try the Dubbo functionality yourself.
Tengine RoadMap
The community has fully upgraded the Nginx core codebase, and the latest Tengine release is compatible with the newest Nginx features. Ongoing work includes additional protocol support, stronger dynamic capabilities beyond Lua, and advanced load‑balancing algorithms.
Alibaba is also transitioning Tengine toward cloud‑native Kubernetes, integrating Service Mesh, Ingress, Egress, and other cloud‑native technologies, with plans to contribute these innovations back to the open‑source community.
Recruitment Notice
The Alibaba Middleware Tengine team, responsible for millions of QPS gateway traffic, is hiring engineers experienced with Nginx, Golang, Kubernetes, Service Mesh, and DevOps. Contact: [email protected]
Reference Reading:
Dubbo 2.7.5 release – 30% performance boost, HTTP/2, TLS, Protobuf support
Joe Armstrong’s favorite Erlang program
Clojure in 2020
Deep guide to running Elasticsearch in production
Apache Dubbo 2019‑2020 annual review
Author: Wu Mengqi. Original technical article – contributions are welcome via the public account’s contact menu.
High Availability Architecture
Official account for High Availability Architecture.
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.