C# High-Performance Server Development: In-Depth Survey of Open-Source Projects
This report compares 40+ open-source projects for high-performance server development in C#/.NET, covering web frameworks, networking libraries, Actor frameworks, game servers, microservices, message buses, RPC, serialization, data access, and HTTP clients, with benchmarks and selection guidance.
Key points
- Web frameworks: ASP.NET Core (.NET 9) reaches 27,530,836 req/s plaintext and 2,546,481 req/s JSON on TechEmpower Round 23; FastEndpoints (~254K req/s, Bombardier) outperforms MVC (~225K) by roughly 13%. Minimal APIs are recommended over MVC for simple APIs.
- Networking: NetCoreServer leads with 9.4M msg/s TCP throughput and ~106ns latency; SuperSocket offers flexible pipeline architecture; DotNetty is in low maintenance (prefer SpanNetty for Netty-style APIs in new projects).
- Actor frameworks: Proto.Actor is fastest in message throughput and actor activation; Orleans offers the best memory efficiency, built-in persistence, and virtual actors; Akka.NET suits stream processing and event sourcing with Akka.Streams/Persistence.
- Game servers: Mirror is the top Unity networking library; DarkRift for authoritative servers; Riptide for lightweight UDP; Nakama for a complete game backend (written in Go).
- Microservices: Dapr (CNCF graduated) for cloud-native/multi-language; Ocelot as API gateway; Steeltoe for Spring ecosystem; Service Fabric for Azure.
- Message buses: MassTransit (open-source first choice, Saga support), NServiceBus (enterprise, commercial SLA), CAP (distributed transactions + EventBus), Rebus (lightweight), EasyNetQ (RabbitMQ-only).
- RPC: gRPC.NET for standard cross-language microservices; MagicOnion for C#-first, code-first gRPC with native Unity support.
- Serialization: MemoryPack is fastest (~20ns serialize/deserialize), vs MessagePack IntKey (84/73ns), Protobuf.NET (176/266ns), System.Text.Json (276/420ns), Newtonsoft.Json (1,433/2,783ns). MessagePack/Protobuf for cross-language, MemoryPack for games/caching.
- Data access: Dapper (17.5k stars) is the fastest micro-ORM (~1.166ms single query, ~13KB memory); EF Core offers full features/migrations; RepoDb excels at bulk inserts (~20ms for 10k rows); Linq2Db for high-performance LINQ. A common hybrid is EF Core (writes) + Dapper (reads).
- HTTP clients: Refit is fastest (~265µs) with type safety; Flurl for fluent syntax; RestSharp most flexible; raw HttpClient for maximum performance; YARP for reverse proxying.
- High-performance Web API / microservices: FastEndpoints or Minimal APIs, MemoryPack/MessagePack, Dapper + EF Core, gRPC.NET, MassTransit, Refit.
- Real-time multiplayer game server: Mirror (Unity) or NetCoreServer (standalone), MemoryPack, Dapper, Orleans for state, StackExchange.Redis.
- Distributed enterprise app: ASP.NET Core, Orleans, NServiceBus or CAP, EF Core, Ocelot/YARP, Dapr.
- IoT / high-concurrency: ASP.NET Core + SignalR, NetCoreServer, Proto.Actor or Akka.NET, MassTransit + Kafka, MemoryPack, TimescaleDB + Dapper.
- Event sourcing / CQRS: ASP.NET Core, Akka.NET, Marten or KurrentDB, MassTransit, Dapper + PostgreSQL, MessagePack.
- Use Native AOT compilation (.NET 8+)
- Enable connection pooling and reuse; configure PooledConnectionLifetime
- Use
AsNoTracking()for read-only queries and compiled queries - Prefer MemoryPack/MessagePack serialization
- Reduce allocations with
Span<T>andMemory<T> - Enable response compression
- Benchmark with BenchmarkDotNet; monitor GC and allocations
- ASP.NET Core: https://github.com/dotnet/aspnetcore
- Orleans: https://github.com/dotnet/orleans
- YARP: https://github.com/dotnet/yarp
- NetCoreServer: https://github.com/chronoxor/NetCoreServer
- SuperSocket: https://github.com/kerryjiang/SuperSocket
- DotNetty: https://github.com/Azure/DotNetty
- Akka.NET: https://github.com/akkadotnet/akka.net
- Proto.Actor: https://github.com/asynkron/protoactor-dotnet
- Mirror: https://github.com/MirrorNetworking/Mirror
- DarkRift: https://github.com/DarkRiftNetworking/DarkRift
- Riptide: https://github.com/RiptideNetworking/Riptide
- Nakama: https://github.com/heroiclabs/nakama
- Dapr .NET SDK: https://github.com/dapr/dotnet-sdk
- MassTransit: https://github.com/MassTransit/MassTransit
- NServiceBus: https://github.com/Particular/NServiceBus
- CAP: https://github.com/dotnetcore/CAP
- Ocelot: https://github.com/ThreeMammals/Ocelot
- MagicOnion: https://github.com/Cysharp/MagicOnion
- MemoryPack: https://github.com/Cysharp/MemoryPack
- MessagePack-CSharp: https://github.com/MessagePack-CSharp/MessagePack-CSharp
- gRPC.NET: https://github.com/grpc/grpc-dotnet
- Dapper: https://github.com/DapperLib/Dapper
- EF Core: https://github.com/dotnet/efcore
- RepoDb: https://github.com/mikependon/RepoDB
- Linq2Db: https://github.com/linq2db/linq2db
- FastEndpoints: https://github.com/FastEndpoints/FastEndpoints
- Carter: https://github.com/CarterCommunity/Carter
- Refit: https://github.com/reactiveui/refit
- Flurl: https://github.com/tmenier/Flurl
- RestSharp: https://github.com/restsharp/RestSharp
Recommended stacks by scenario
Pitfalls to avoid
| Avoid | Use instead | Reason | |-------|-------------|--------| | BinaryFormatter | MemoryPack | Security vulnerability, deprecated | | SpanJson | System.Text.Json | Archived, unmaintained | | ZeroFormatter | MemoryPack | Maintenance mode, superseded | | New HttpClient per request | IHttpClientFactory | Socket/port exhaustion | | MVC for simple APIs | Minimal APIs | ~37% slower | | DotNetty (new projects) | SpanNetty | Inactive maintenance |