MCPcopy Index your code
hub / github.com/EtaCassiopeia/gmf

github.com/EtaCassiopeia/gmf @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
85 symbols 139 edges 17 files 14 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GMF - Thread-Per-Core gRPC Server Framework

CI

A high-performance, runtime-agnostic gRPC server framework for Rust using thread-per-core architecture.

GMF pins one event loop per physical CPU core with no work-stealing, no shared task queues, and no lock contention on the request path.

Runtimes

Runtime Feature Platforms Backend
monoio (default) monoio-runtime Linux, macOS io_uring / kqueue
glommio glommio-runtime Linux only io_uring
tokio tokio-runtime All epoll / kqueue

Quick Start

[dependencies]
gmf = "2.0.0"
use gmf::server::MonoioServer;

MonoioServer::builder()
    .addr("0.0.0.0:50051".parse()?)
    .max_connections(10240)
    .num_cores(4)
    .build()
    .serve(GreeterServer::new(MyGreeter))?;

To use a different runtime:

[dependencies]
gmf = { version = "2.0.0", default-features = false, features = ["tokio-runtime"] }

Graceful Shutdown

MonoioServer::builder()
    .addr(addr)
    .build()
    .serve_with_shutdown(service, signal)?;

Where signal is any Future<Output = ()> + Send + 'static (e.g. a ctrl-c handler).

How It Works

Thread-Per-Core Architecture

Each core runs an independent event loop with its own TCP listener and connection limiter. On Linux, the kernel distributes connections across cores via SO_REUSEPORT and each core gets its own io_uring instance (monoio/glommio) or epoll fd (tokio). No userspace load balancing, no shared task queues.

Documentation

Document Description
Architecture Thread-per-core design, io_uring, CPU pinning, request lifecycle
Benchmarking How to benchmark with ghz and criterion
Development Building, testing, Docker setup
Platform Notes Linux vs macOS differences, Docker IPv6

Performance

GMF's architecture is designed to outperform work-stealing runtimes on dedicated multi-core Linux servers by eliminating shared task queues and lock contention, leveraging io_uring syscall batching (monoio/glommio runtimes), and maintaining CPU cache locality through core pinning. The advantage grows with core count and hardware isolation.

See Benchmarking for how to run your own benchmarks and Architecture for a deep dive into why thread-per-core scales better.

License

Apache-2.0

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 43
Class 24
Function 12
Interface 5
Enum 1

Languages

Rust100%

Modules by API surface

gmf/src/server/tokio_runtime.rs15 symbols
gmf/src/server/gmf_server.rs15 symbols
gmf/src/server/glommio_runtime.rs15 symbols
gmf/src/server/monoio_runtime.rs13 symbols
gmf/src/server/runtime.rs5 symbols
gmf/src/server/hyper_io.rs5 symbols
examples/src/helloworld-tonic/server.rs3 symbols
examples/src/helloworld-gmf/tokio_server.rs3 symbols
examples/src/helloworld-gmf/server.rs3 symbols
gmf/src/server/config.rs2 symbols
examples/benches/benchmark.rs2 symbols
gmf/src/server/error.rs1 symbols

For agents

$ claude mcp add gmf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page