[grpc-io] Re: Scala gRPC High CPU Utilization

2018-09-11 Thread 'kos' via grpc.io
That's what I understood it to be as well - we actually did some testing with batching and saw no improvement. I just wanted to double check! Here's the JVM flags I'm using. This service is running in a docker container which can result in Java not getting the correct CPU core count. Due to

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-09-11 Thread 'Carl Mastrangelo' via grpc.io
An explicit goal of gRPC is to making batching not necessary. You should be able to use unary, or streaming, or any RPC kind really without worrying about the performance. Can you list your JVM flags you use? On Monday, September 10, 2018 at 10:04:40 PM UTC-7, Kos wrote: > > Hey Carl, > >

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-09-10 Thread 'Kos' via grpc.io
Hey Carl, Yup the way you've described it is exactly how I have it setup. private def channelBuilder(address: String): ManagedChannel = { val interceptor = MonitoringClientInterceptor.create(Configuration.allMetrics()) val builder = NettyChannelBuilder .forAddress(address,

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-08-31 Thread 'Carl Mastrangelo' via grpc.io
It should be one ManagedChannel per host*. There are a lot of batching opportunities possible when using just one channel. For example, TLS encryption can work on larger block sizes at a time. Another example is that netty can poll on fewer threads, meaning fewer wakeups across all your

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-08-31 Thread 'Kos' via grpc.io
Hi Carl, I did run a Yourkit run against my service and what I see is many threads being created for the event loop group - they're all named something like: 'grpc-default-worker-ELG-...'. I did some reading on your other posts and saw you recommended using an ELG bounded to 1-2 threads. I

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-08-29 Thread 'Carl Mastrangelo' via grpc.io
More info is needed to figure out why this is slow. Have you use JProfiler or Yourkit before? There are a couple Java profilers (perf, even) that can tell you where the CPU is going to. Also, you should consider turning on gc logging to see if memory is being consumed too fast. Our tuned

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-08-28 Thread kaustubh via grpc.io
Hi Carl, Thanks for responding! I've tried a couple different executors and they don't seem to change the behavior. I've done FixedThreadPool with the number of threads = # of cores * 2, the ForkJoinPool.commonPool as you recommended, and the Scala global ExecutionContext which ultimately is a

[grpc-io] Re: Scala gRPC High CPU Utilization

2018-08-28 Thread 'Carl Mastrangelo' via grpc.io
Can you try setting the executor on both the channel and the server builder? I would recommend ForkJoinPool.commonPool(). On Monday, August 27, 2018 at 11:54:19 PM UTC-7, Kos wrote: > > Hi, > > I'm using gRPC in a new Scala service and I'm seeing unexpectedly high CPU > utilization. I see