mioco

Build Status crates.io Gitter Chat
Documentation

Introduction

Scalable, coroutine-based, asynchronous IO handling library for Rust programming language.

Using mioco you can handle mio-based IO, using set of synchronous-IO handling functions. Based on asynchronous mio events mioco will cooperatively schedule your handlers.

You can think of mioco as of Node.js for Rust or green threads on top of mio.

mioco is a young project, but we think it's already very useful. See projects using mioco. If you're considering or already using mioco, please drop us a line on #mioco gitter.im.

Read Documentation for details.

If you need help, try asking on #mioco gitter.im. If still no luck, try rust user forum.

To report a bug or ask for features use github issues.

Building & running

Note: You must be using nightly Rust release. If you're using multirust, which is highly recommended, switch with multirust default nightly command.

To start test echo server:

cargo run --release --example echo

For daily work:

make all

Projects using mioco:

Send PR or drop a link on gitter.

Benchmarks

HTTP Server

Around 7 million requests per second using trivial code. It can perform.

% wrk -t8 -c100 -d10s http://localhost:5555 Running 10s test @ http://localhost:5555 8 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.94s 1.04s 3.19s 62.78% Req/Sec 659.38k 523.27k 3.22M 58.59% 68646374 requests in 10.01s, 3.39GB read Socket errors: connect 0, read 0, write 0, timeout 263 Requests/sec: 6855668.81 Transfer/sec: 346.52MB

See cheating-http-server.rs.

TCP Echo Server

TODO: SMP support was added. Rerun the tests. bench2 is around 370k/s now.

Beware: This is very naive comparison! I tried to run it fairly, but I might have missed something. Also no effort was spent on optimizing neither mioco nor other tested tcp echo implementations.

In thousands requests per second:

| | bench1 | bench2 | |:--------|---------:|---------:| | libev | 183 | 225 | | node | 37 | 42 | | mio | 156 | 190 | | mioco | 157 | 177 |

Server implementation tested:

Benchmarks used:

Machine used: