-
Notifications
You must be signed in to change notification settings - Fork 5.3k
A proposal of high-performance L7 network GoLang extension for Envoy. #15152
Description
Background
Envoy is an excellent Sidecar in the field of Service Mesh. The use of modern C++ guarantees its high performance, but also increases the difficulty for developers. Although Envoy also supports Lua and WASM to enhance its scalability, there are some shortcomings in some scenarios (as shown in the table below); With the growth of GoLang's cloud native language ecology and popularity, We introduce a proposal that allows Envoy to support GoLang extension capabilities.
Lua vs GoLang vs WASM Extension on Envoy
| Name | Advantage | Disadvantage |
|---|---|---|
| Lua Extension | easier to develop | fewer SDKs supports and smaller ecosystem |
| GoLang Extension | richer ecology and more SDKs than Lua, less memory copies and higher performance than WASM | Isolation is not as strong as WASM,go runtime may cause more performance overhead |
| WASM Extension | Cross-language language support (C/C++/Rust), isolation, security, agility, etc | In the experimental stage, performance loss is large, Can not re-use the existing golang sdk, need to transform the network io |
Design
By adding the Http GoLang extension filter extension to Envoy's HTTP filter, users can implement Envoy's http filter using GoLang via the GoLang L7 extension SDK.
Http Golang extension filter
GoLang http extension filter on the Envoy side implemented in C++, this module is used to call the http filter implemented by the developer through GoLang.
GoLang L7 extension SDK
GoLang L7 extension SDK exports some CGO APIs for interaction between the Http GoLang extension filter and the GoLang http filter.
The specific architecture is as follows:
Best practice
Improve Dapr gRPC performence by Envoy L7 GoLang extension
In some scenarios, we need to use Envoy (mesh) and Dapr (application runtime implemented in GoLang) simultaneously. In these cases, we plan to make Dapr as an envoy's http2 filter (enabled by our GoLang extension module), and re-use the existing component sdks (the reason that we do not use Wasm is GoLang's prematured support of wasm, and the requirement of non-blocking IO model brought by Envoy). The combination of Dapr and Envoy makes it more convenient for maintainance and management than two seperated productions. Let alone the improvement on the performance for Dapr.
Run MOSN stream filter on Envoy via Envoy L7 GoLang extension
In the MOSN project, we use GoLang through the Envoy GoLang extension module(experimental stage) to easily implement Envoy's dynamic routing capabilities: mosn/mosn#1563.
Looking forward to your ideas/comments on this proposal! @mattklein123 @htuch @alyssawilk @lizan thanks.
