How Multiplexing Boosts .NET Core to Achieve Million‑Level RPS
This article explains the limitations of single‑connection request handling, demonstrates the performance benefits of multiplexing, and details a .NET Core test that reaches a million requests per second with low latency using Protobuf messages and BeetleX integration.
1. Problems of Single Path
Each request‑response pair occupies a dedicated connection, monopolizing network read/write resources. Idle time wastes bandwidth, and the I/O overhead limits the achievable requests per second (RPS), causing performance bottlenecks and higher resource consumption when scaling.
2. Advantages of Multiplexing
Multiplexing allows multiple request‑response streams over a single connection, dramatically reducing the number of connections, consolidating I/O operations, and improving overall network throughput and latency.
3. Achieving Million‑Level RPS with Multiplexing
The author implemented a multiplexing test on .NET Core, aiming for single‑service throughput of one million RPS with low latency. The test workflow includes integrating multiplexing into BeetleX, which automatically merges messages into a single buffer to reduce I/O reads and writes.
4. Test Message Structure
Protobuf is used as the serialization format for request and response messages.
4.1 Request Message
4.2 Response Message
4.3 Server Processing Code
4.4 Service Response Object
Received messages are queued for processing; the server records request‑response times and total message counts.
4.5 Client Request Code
4.6 Client Test Initiation Code
The test runs with ten concurrent connections, reusing them for request‑response multiplexing.
5. Test Configuration
Two Alibaba Cloud servers with 12‑core CPUs (6 physical cores, 12 threads) running Ubuntu 16.04 and .NET Core 2.14 were used.
6. Test Results
6.1 Client Statistics
6.2 Server Statistics
6.3 Bandwidth Statistics
With ten multiplexed connections, the system handled up to 1,000,000 responses per second, most responses latency between 1–3 ms.
6.4 Test Code
https://github.com/IKende/BeetleX/blob/master/samples/MultiplexingConnectionTest.zip
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
