Simple message exchange network with channel-subscription based structure. EaseChat was originally designed as a chat message exchanging service for games, but its usage could be widen to debug messages and commands for maintaining.
Although the first version of EaseChat Nexus may be less flexible, we deployed it on production use months ago. Its record on non-pausing and reboot-free continuous execution is 3,432 hours on our mini-game server network region, since 30 Jan to 22 Jun 2019, killed mistaken by a ctrl-c quit. The network consists of ~350 endpoints and produces ~1k messages on average per second, their CPU and RAM usage being low at the same time. Players mostly suggest it 'Great' in our recent survey on this part of the game's experience.
| Name | Description |
|---|---|
| easechat-client-j | Netty-based Java implementation of EaseChat client oriented to production |
| easechat-nexus-rs | Production Rust EaseChat Nexus implementation using Tokio and tokio-tungstenite |
| easechat-exec-rs | Legacy in-progress Rust CLI application, excluded from the active workspace |
| easechat-nexus-v2-rs | Legacy in-progress redesigned Rust protocol library, excluded from the active workspace |
| easechat-record-rs | Legacy in-progress Rust recorder client, excluded from the active workspace |
- Install rust, or run
rustup updateif already installed. - Execute
cargo run -p ease_chat_nexusin project root. - The default listen address is
0.0.0.0:6500. Pass the first CLI argument to override it, for example:
cargo run -p ease_chat_nexus -- 127.0.0.1:6500For production builds:
cargo build --release -p ease_chat_nexus
./target/release/ease_chat_nexus 0.0.0.0:6500The Dockerfile in the parent repository builds the release binary in a Rust builder image and runs only the compiled Nexus executable in the runtime image.
The production Nexus keeps the original WebSocket text protocol unchanged:
1hclient hello1cchannel subscription1tmessage transmit1dclient disconnect1rserver receive message
Protocol string length fields are interpreted as UTF-8 byte lengths, matching the Java client protocol encoding. Messages may contain | inside length-delimited fields.
The server keeps the original console command set:
list/lpush/msg/say/send/pstop/quit/exit/qhuaji
Build the release server and stress client:
cargo build --release -p ease_chat_nexus --example stressStart Nexus:
./target/release/ease_chat_nexus 127.0.0.1:16500Run a baseline test with 350 clients and a 10-channel fanout:
./target/release/examples/stress \
--url ws://127.0.0.1:16500 \
--clients 350 \
--publishers 10 \
--channels 10 \
--duration 30 \
--message-size 64 \
--target-rate 3500 \
--connect-parallel 128Run a high-fanout broadcast test:
./target/release/examples/stress \
--url ws://127.0.0.1:16500 \
--clients 350 \
--publishers 10 \
--channels 1 \
--duration 30 \
--message-size 64 \
--target-rate 400 \
--connect-parallel 128Current local stress results on a Windows development machine show a stable range around 120k-140k client deliveries per second. The exact limit depends on channel fanout, client read speed, and the machine running both Nexus and stress clients.