akka / akka-grpc

Akka gRPC
https://doc.akka.io/docs/akka-grpc/
Other
432 stars 123 forks source link

Investigate performance of unary calls #252

Open patriknw opened 6 years ago

patriknw commented 6 years ago

The performance tests showed that the performance of unary calls wasn't great. Investigate and possibly improve.

patriknw commented 6 years ago

Not top priority but we might do a timeboxed effort when other things of the MVP are under control

johanandren commented 6 years ago

I'll spend a few hours on this now.

johanandren commented 6 years ago

A few hours spent, findings:

Still no idea about what causes the worst case 4x degradation compared to java-grpc, although there seems to be a lot of small things we could improve in general, both in Akka gRPC and the HTTP/2 server impl (tail on vector in header parsing, allocating 32k buffer for every outgoing response when compression is used etc).

Added support for benching without TLS in #278 and benched suspecting the Netty TLS stuff is much faster than Jetty ALPN but that just showed more normal improvements.

What I didn't get to in the time box I set out is profiling on Linux with flame graphs/native calls collected to see if there is something going on that YourKit doesn't catch.

johanandren commented 6 years ago

I should also mention, I tried with the java-grpc benchmark client against the akka-grpc server to check if the 4x was on the client side, it was a bit faster but did not explain the 4x.

johanandren commented 6 years ago

For future reference, this branch contains a few optimizations I tried out but didn't feel happy enough about to actually PR: https://github.com/johanandren/akka-grpc/tree/wip-252-unary-calls-performance-johanandren