Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rainj-me committed Dec 20, 2023
1 parent e814dba commit dbf2fd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*.pem

/examples/certs
/docs/cloudwego.github.io
/docs/cloudwego.github.io
10 changes: 5 additions & 5 deletions docs/monolake.md
Original file line number Diff line number Diff line change
@@ -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
+-----------+ +-----------+ +-----------+ +-----------+ +------------+ +-----------+
Expand All @@ -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 | | | | | | | | |
+-----------+ +-----------+ +-----------+ +-----------+ +-----------+
```
Expand All @@ -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.

Expand Down

0 comments on commit dbf2fd2

Please sign in to comment.