Skip to content

Commit

Permalink
Fix: Remove latency graphs and udpate readme
Browse files Browse the repository at this point in the history
  • Loading branch information
har23k committed Nov 15, 2024
1 parent a7335d5 commit a3f98ba
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion content/en/docs/monolake/Architecture/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Alternatively, you might use a `HashMap` to manage the context data, but this ap

## How `certain_map` Helps

The `certain_map` crate solves this problem by providing a typed map that ensures the existence of specific items at compile-time. When you define a `Context` struct using `certain_map`, the compiler will enforce that certain fields are present, preventing runtime errors and simplifying the implementation of your services.
The `certain_map` crate solves this problem by providing a a typed-map-like struct that ensures the existence of specific items at compile-time. When you define a `Context` struct using `certain_map`, the compiler will enforce that certain fields are present, preventing runtime errors and simplifying the implementation of your services.

Here's an example of how you might set up the context for your project:

Expand Down
30 changes: 16 additions & 14 deletions content/en/docs/monolake/Overview/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,40 @@ keywords: ["Proxy", "Rust", "io-uring"]

## Monolake

Monolake is an open-source framework for developing high-performance network services like proxies and gateways. It is built from the ground up as a blank slate design, starting with a custom async runtime called [Monoio](https://docs.rs/crate/monoio/latest) that has first-class support for the io_uring Linux kernel feature.
Monolake is a framework for developing high-performance network services like proxies and gateways. It is built from the ground up as a blank slate design, starting with a custom async runtime called [Monoio](https://docs.rs/crate/monoio/latest) that has first-class support for the io_uring Linux kernel feature.

While the most widely used Rust async runtime is [Tokio](https://docs.rs/tokio/latest/tokio/), which is an excellent and high-performance epoll/kqueue-based runtime, Monolake takes a different approach. The monoio runtime developed by Bytedance is designed with a thread-per-core model in mind, allowing Monolake to extract maximum performance from io_uring's highly efficient asynchronous I/O operations.

By building Monolake on this novel runtime foundation, the team was able to incorporate new first-class support for io_uring throughout the ecosystem. This includes io_uring-specific IO traits and a unique service architecture that differs from the popular Tower implementation. Monolake also includes io_uring-optimized implementations for protocols like Thrift and HTTP.

The Monolake team has used this framework to build a variety of high-performance network components, including:
- HTTP and Thrift proxies
- Application gateways (HTTP-to-Thrift)
- gRPC proxies
The Monolake framework has been used to build various high-performance proxies and gateways, and it is actively deployed in production at ByteDance. Its use cases are wide-ranging and include:

By focusing on cutting-edge Rust and io_uring, Monolake aims to provide developers with a powerful toolkit for building the next generation of high-performance network services.
- Application Gateways: For protocol conversion, such as HTTP to Thrift
- Security Gateways: Providing pseudonymization for gRPC and Thrift RPCs

## Monolake Proxy

[Monolake Proxy](https://github.com/cloudwego/monolake/tree/main/monolake) is a reference implementation that leverages the various components within the Monolake framework to build a high-performance HTTP and Thrift proxy. This project serves as a showcase for the unique features and capabilities of the Monolake ecosystem. By utilizing the efficient networking capabilities of the monoio-transports crate, the modular service composition of service-async, and the type-safe context management provided by certain-map, Monolake Proxy demonstrates the practical application of the Monolake framework. Additionally, this reference implementation allows for the collection of benchmarks, enabling comparisons against other popular proxy solutions like Nginx and Envoy.

## Performance

### Test environment

- AWS instance: c6a.8xlarge
- CPU: AMD EPYC 7R13 Processo, 16 cores, 32 threads
- Memory: 64GB
- OS: 6.1.94-99.176.amzn2023.x86_64, Amazon Linux 2023.5.20240805
- Nginx: nginx/1.24.0

#### Request Per Second (RPS) vs. Body Size
| RPS | TP99 |
| HTTPS | HTTP |
| :------------------------------------------------- | :-------------------------------------------------: |
| ![image](/img/docs/https_req_per_sec_vs_body_size.png) | ![image](/img/docs/https_tp99_latency_vs_body_size.png) |
| |
| ![image](/img/docs/http_req_per_sec_vs_body_size.png) | ![image](/img/docs/http_tp99_latency_vs_body_size.png) |
| ![image](/img/docs/https_req_per_sec_vs_body_size.png) | ![image](/img/docs/http_req_per_sec_vs_body_size.png) |

### Concurrency performance
| RPS | TP99 |
| HTTPS | HTTP |
| :------------------------------------------------- | :-------------------------------------------------: |
| ![image](/img/docs/https_req_per_sec_vs_worker_threads.png) | ![image](/img/docs/https_tp99_latency_vs_worker_threads.png) |
| |
| ![image](/img/docs/http_req_per_sec_vs_worker_threads.png) | ![image](/img/docs/http_tp99_latency_vs_worker_threads.png) |
| ![image](/img/docs/https_req_per_sec_vs_worker_threads.png) | ![image](/img/docs/http_req_per_sec_vs_worker_threads.png) |

## Related Projects

Expand Down
Binary file modified static/img/docs/http_req_per_sec_vs_worker_threads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/img/docs/http_tp99_latency_vs_body_size.png
Binary file not shown.
Binary file not shown.
Binary file removed static/img/docs/https_tp99_latency_vs_body_size.png
Binary file not shown.
Binary file not shown.

0 comments on commit a3f98ba

Please sign in to comment.