Closed marcoferrer closed 5 years ago
Referencing original discussion. https://github.com/Kotlin/kotlinx.coroutines/issues/360
Working on finishing up the unit test / docs. Hoping to release soon after any pending user feedback
Benchmark application added based on grpc-benchmarks
api.
These are initial results. The test parameters will need further refinement.
./qps_client --address=127.0.0.1:8000 --channels=10 --server_payload=1 --client_payload=1
Server Executor: ForkJoinPool(parallelism = 4)
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 459
90%ile Latency (in micros): 1151
95%ile Latency (in micros): 2191
99%ile Latency (in micros): 11775
99.9%ile Latency (in micros): 124415
Maximum Latency (in micros): 260095
QPS: 87355
Server Executor: directExecutor()
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 431
90%ile Latency (in micros): 1003
95%ile Latency (in micros): 1975
99%ile Latency (in micros): 8383
99.9%ile Latency (in micros): 39679
Maximum Latency (in micros): 148479
QPS: 122236
Client Executor: directExecutor() & Server Executor: directExecutor()
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 397
90%ile Latency (in micros): 855
95%ile Latency (in micros): 1215
99%ile Latency (in micros): 2767
99.9%ile Latency (in micros): 7679
Maximum Latency (in micros): 89087
QPS: 178784
./qps_client --address=127.0.0.1:8000 --channels=10 --server_payload=1 --client_payload=1 --streaming_rpcs=true
Server Executor: ForkJoinPool(parallelism = 4)
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 415
90%ile Latency (in micros): 883
95%ile Latency (in micros): 1359
99%ile Latency (in micros): 3295
99.9%ile Latency (in micros): 10751
Maximum Latency (in micros): 245759
QPS: 174428
Server Executor: directExecutor()
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 321
90%ile Latency (in micros): 559
95%ile Latency (in micros): 779
99%ile Latency (in micros): 1831
99.9%ile Latency (in micros): 5567
Maximum Latency (in micros): 119295
QPS: 250821
Client Executor: directExecutor() & Server Executor: directExecutor()
Channels: 10
Outstanding RPCs per Channel: 10
Server Payload Size: 1
Client Payload Size: 1
50%ile Latency (in micros): 249
90%ile Latency (in micros): 373
95%ile Latency (in micros): 481
99%ile Latency (in micros): 1023
99.9%ile Latency (in micros): 2655
Maximum Latency (in micros): 125439
QPS: 348325
This is PR introduces client stub and service impl code generation for grpc. It contains an entire overhaul of the coroutines grpc api. Its open to any feedback.
Please reference the client / server example included. It contains a sample of the expected output for discussion.
You can try out the changes by running the following command to get started with a preconfigured template project. (kotlin-coroutines-gRPC-template)
Or via the version
0.2.2-SNAPSHOT
using the following repo in your build file.And the following kroto config
Some of the key points are:
CoroutineScope
interfacegrpc-java
patterns, while still fully embracing coroutine idioms and features.SendChannel.send { }
andCompletableDeferred.complete { }
RpcMethod
annotation fromgrpc-java
. RpcMethod.javaThis change is