Overview

This doc covers the overview of Monolake, a high-performance network service framework.

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 that has first-class support for the io_uring Linux kernel feature.

While the most widely used Rust async runtime is Tokio, which is a great 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

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.

Monolake Proxy

Monolake Proxy 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

HAR TODO: Move performance section from benchmarks to here

Test environment

Concurrency performance

QPS TP99 TP999
image image image

Throughput performance

Change packet size with a fixed concurrency of 100.

QPS TP99 TP999
image image image
  • Monoio: A high-performance thread-per-core io_uring based async runtime
Crate Description
monoio-transports A foundational crate that provides high-performance, modular networking capabilities, including connectors and utilities for efficient network communications
service-async A foundational crate that introduces a refined Service trait with efficient borrowing and zero-cost abstractions, as well as utilities for service composition and state management
certain-map A foundational crate that provides a typed map data structure, ensuring the existence of specific items at compile-time, useful for managing data dependencies between services
monoio-thrift Monoio native, io_uring compatible thrift implementation
monoio-http Monoio native, io_uring compatible HTTP/1.1 and HTTP/2 implementation
monoio-nativetls The native-tls implementation compatible with monoio
monoio-rustls The rustls implementation compatible with monoio

Blogs


Last modified November 6, 2024 : Feat: Documentation for monolake (475b5e9)