Hello,
I am using grpc for a university research project.
My experiment setup is as follows: I have a synchronous server running on one machine. On another machine, I start a process that creates and launches multiple threads (say X threads) that act as clients, and make synchronous rpc calls to this synchronous server. The client threads are then in the blocked state, waiting for responses from the server.
I want to find out how each client thread gets woken up when the synchronous rpc call completes, and the response is returned to the client. Is it that grpc has its own underlying thread pool where threads are woken up at random until the correct thread is woken up, which then notifies the corresponding thread in the 'X' client threads that I've created?
I ask because I notice a strange behavior: As I go on increasing the number of client threads, the responses take longer and longer to return to each client. Using MM1 queuing theory, I eliminated queuing at the server as the reason: the actual response latencies are orders of magnitude greater than what is contributed by queuing. Also, upon looking at time stamps on the send request to server and receive response from server paths, I find that the receive response from server path is the culprit.
This possibly implies that the client is not able to pick up the response exactly when the response is received, even though it was blocked waiting for this response. So, my hypothesis is that random threads are woken up, until the correct one is identified, which then waked up the client thread that I created.