From dbf2fd2b928839c155ce2731bc2f7b45ec3b3356 Mon Sep 17 00:00:00 2001 From: Rain Jiang Date: Wed, 20 Dec 2023 21:37:49 +0000 Subject: [PATCH] address comments --- .gitignore | 2 +- docs/monolake.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1da6252..3d69617 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ *.pem /examples/certs -/docs/cloudwego.github.io \ No newline at end of file +/docs/cloudwego.github.io diff --git a/docs/monolake.md b/docs/monolake.md index ddba79e..05bb2ae 100644 --- a/docs/monolake.md +++ b/docs/monolake.md @@ -1,10 +1,10 @@ -# Monolake, a proxy framework base on Rust and Iouring +# Monolake, a proxy framework base on Rust and io_uring -Earlier 2023, Cloudflare released a blog to introduce their Oxy, a Rust-based modern proxy framework. We have the similar requirements at Volcano Engine (a public cloud from Bytedance Inc.), so we start Monolake project, a layer 4/7 proxy framework base on Rust and Iouring. +Earlier 2023, Cloudflare released a blog to introduce their Oxy, a Rust-based modern proxy framework. We have the similar requirements at Volcano Engine (a public cloud from Bytedance Inc.), so we start Monolake project, a layer 4/7 proxy framework base on Rust and io_uring. ## Architecture of Monolake -There are 3 major categories in monolake, the runtime & transport, the tls and the http. Monolake currently supoprt Iouring and epoll runtime which are benefit from monoio(a thread-per-core rust runtime). The layer 4 proxy is implemented in monolake. The tls category currently support both rustls and native-tls, user can switch between these two solutions in case there is critical security defect in one of them. For the http category, monolake support http/1.1 and h2, we are currently working on the thrift protocol support, the grpc and h3 protocol support is planned. +There are 3 major categories in monolake, the runtime & transport, the tls and the http. Monolake currently supoprt io_uring and epoll runtime which are benefit from monoio(a thread-per-core rust runtime). The layer 4 proxy is implemented in monolake. The tls category currently support both rustls and native-tls, user can switch between these two solutions in case there is critical security defect in one of them. For the http category, monolake support http/1.1 and h2, we are currently working on the thrift protocol support, the grpc and h3 protocol support is planned. ```plain +-----------+ +-----------+ +-----------+ +-----------+ +------------+ +-----------+ @@ -16,7 +16,7 @@ There are 3 major categories in monolake, the runtime & transport, the tls and t +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ -|Runtime/ | | Iouring | | epoll | | monoio | | monolake | +|Runtime/ | | io_uring | | epoll | | monoio | | monolake | |Transport | | | | | | | | | +-----------+ +-----------+ +-----------+ +-----------+ +-----------+ ``` @@ -25,7 +25,7 @@ Figure 1, the layers and monolake architecture Besides multi-protocols and proxy features, monolake provides the ability to update the handler chains at runtime. Combine with the linux SO_REUSEPORT socket option, users can upgrade monolake binary at runtime. -## Why monoio runtime with Thread-per-Core and Iouring support +## Why monoio runtime with Thread-per-Core and io_uring support As we known, performance is one of the main factor for layer 4 and layer 7 proxy framework. To achieve this goal during the design phases, we decide to choose thread-per-core with CPU binding and io_uring as our major features. With thread-per-core feature, monolake can avoid the the context switch and inter process communication. With io_uring feature, monolake can avoid copy the memory between kernel space and the userspace. With these in mind, we carefully compare the Rust runtime between tokio, glommio and monoio. Tokio is the most popular asynchronous Rust runtime which has the most mature communities, but its thread model is not thread-per-core, and the async task can schedule on any thread which may requires context switch and lots of cross threads communication. Glommio and monoio are similar, both support io_uring and thread-per-core, we finally choose monoio due to the supportive from monoio community.