I am load testing my grpc server to see how it performs under high 
throughput and what the average request latency is. 

It is configured as:

server = NettyServerBuilder.forPort(port)
        .addService(testService)

        
.executor(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()))

        .build()
        .start();


The machine the server is running on has 16 CPUs. (2 threads per core, 8 
cores)

On my client, I am using Guava's RateLimiter 
<https://google.github.io/guava/releases/22.0/api/docs/index.html?com/google/common/util/concurrent/RateLimiter.html>
 to 
send messages in a bi-di stream at 1000 per second. (All using a shared 
channel and stub).
Each message I am sending in a Runnable() just to parallelize the work. 
Same behavior happens if I just call `onNext` directly without the task 
submission step.
Code roughly looks like:

final long startTime = System.currentTimeMillis();

final long oneMinute = TimeUnit.MINUTES.toMillis(1);

final RateLimiter rateLimiter = RateLimiter.create(1000);

final StreamObserver<TestMessageRequest> requestObserver = 
client.asyncStub.testMessageRpc(client.replyObserver);

while (System.currentTimeMillis() - startTime < oneMinute) { 
    rateLimiter.acquire(1);
    threadPool.submit(() -> {

       TestMessageRequest request = TestMessageRequest.getDefaultInstance();

       requestObserver.onNext(request);
    });
}


So anywhere from the 20-60 second mark my server throws a:
 SEVERE: Exception while executing runnable 
io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1@48544a03
     [java] java.lang.OutOfMemoryError: GC overhead limit exceeded

Am I doing something wrong? Is there any way to have the server support 
this high load. 

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/5da1e865-e9b7-4a9c-9f42-55f1ad0050c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to