-
Notifications
You must be signed in to change notification settings - Fork 4k
what is the best practice to handle such kind of traffic? #3057
Description
Please answer these questions before submitting your issue.
What version of gRPC are you using?
1.0.0
What JVM are you using (java -version)?
JDK1.7.0_79
What did you do?
when I run top, I found about 100 thread are running(or waiting) in our GRPC server.
Threads: 98 total, 6 running, 92 sleeping, 0 stopped, 0 zombie
%Cpu(s): 28.4 us, 5.0 sy, 0.0 ni, 66.1 id, 0.0 wa, 0.0 hi, 0.5 si, 0.0 st
KiB Mem: 12305560 total, 6309616 used, 5995944 free, 141816 buffers
KiB Swap: 0 total, 0 used, 0 free. 2453180 cached Mem
What did you expect to see?
I am not sure this is normal. Will this cause too much context switch?
What did you see instead?
As above.
More details about our application
We build a queue service with gRPC. A bout 1000 nodes(VM) are sending request to our gRPC server with "while(true)" and only several of them could get the real traffic.
We choose the default server, i.e. netty to serve that kind of traffic. So, what is the proper config or coding we should use?
Another question is that we shared the "ManagedChannel" object in about 200 nodes(they may use this object concurrently) and build the stub in each call. Is this the right way to use?