Dotnet core rpc component performance test
The general rpc communication components are highly characteristic, because most of them rpc are based on the characteristics of binary and connection multiplexing. Compared with HTTP(versions below 2.0), they have great performance advantages, which are very suitable for communication between services. In this paper, some on dotnet core platform rpc components performance tests, including grpc, Orleans, xrpc and netx; in fact under the platform rcp components are many, after all, are not spelled out limited personal energy added to the test to go inside.
Test description
In order to better reflect the actual application situation, the function and network environment will be tested in diversity. The call test is based on a remote object or interface operation. The operation method includes simple and relatively complex objects. The tested physical network environment includes 10Gb and common network 1Gb. Test different requests such as 16, 32, 64, 128 and 256 concurrently and obtain The associated total request volume and second concurrency value.
test tools
https://github.com/IKende/CodeBenchmarkDoc
Testing the physical environment
- Client
E3-1230v2 16g
- Server
E5-2670v2 32g
- Network
10Gb and 1Gb
- System
Windows server
Test interface description
public IGreeter interface { Task<HelloReply> SayHello(HelloRequest request); Task<User> Register(string name, string email, string password, string title, string city); Task<List<User>> List(int count); }
Hello
client request
SayHello(new HelloRequest { Name = "you" });
server response
return new HelloReply { Message = "Hello " + request.Name };
Register
client request
Greeter.Register("henryfan", "henryfan@msn.com", "12345678", "cxo", "guangzhou");
server response
return Task.FromResult(new User { Name = name, Email = email, Password = password, Title = title, City = city, CreateTime = DateTime.Now, ID= Guid.NewGuid().ToString("N") });
List
client request
Greeter.List(10);
server response
List<User> items = new List<User>(count); for(int i=0;i<count;i++) { var item = new User { Name = "henryfan", City = "guangzhou", Email = "henryfan@msn.com", Title = "cxo", Password = "12345678", ID = Guid.NewGuid().ToString("N"), CreateTime = DateTime.Now }; items.Add(item); }
Test summary
Because there are many graphs of the test results, it is summarized here first. Interested friends will look at the results after reviewing the summary (this summary is only for the components of the existing test).
- orleans
Strictly speaking, orleans the function is actually beyond rpc the scope of one, because it has cluster and Actorother application integration; as rpc it is simple to use, the basic performance is not bad, if you do not consider multi-platform interaction, just use my personal feeling in . net It is the first choice. The disadvantage is that it does not provide multi-platform support. If you need more dense communication calls, the performance is still relatively poor.
- grpc
As http2.0a combination of protobuf and multi-platform versatility, if your system is multi-environment integration, this is definitely the best choice; but the official performance of the .net implementation is not good, it can be said that a little bad, official It is recommended to use .net core 3.0 as the basic communication support. Since this test is based on .net core 2.2, the test results are poor. Also use it in the use, the protodescription does not support the return value and parameters of the underlying type, all interface method parameters and return must be defined message.
- xrpc
High throughput, ease of use, and support for actor are features that make it easy to handle rpc requests for bandwidth above Gb . The disadvantages are not multi-language platform support. If the application requires high-density communication between services, consider it.
10Gb network test results
16 concurrent
32 concurrent
64 concurrent
128 concurrent
256 concurrent
1Gb network test results
16 concurrent
32 concurrent
64 concurrent
128 concurrent
256 concurrent
Orignal link:https://www.cnblogs.com/smark/p/11451326.html