I use GRPC C++ lib in my distributed SQL engine. I use server stream that client side sends "connect" request then the server side sends data packets by a
sync writer and client side receive data packets by a
async reader.
I use a single stream to pass massive data and be sure that the reader fetches data packets promptly, but I find the stream is halted by every 4-5 seconds sometimes.
To look into this problem, I open the flowctl and timer trace log. I finder the server (sender) consumes out the remote window very fast and the stream is moved to
stalled list. the log is in
client.log
We can find that in 12:39s stream 11 is added to stalled list and waited for a stream updt, in 12:43s , a timer thread receive it and reset the window size, then unblock this write call.
On server side, the log is
server.log, in 12:43 server begin to receive all of the data in a window at once and sent the updt packet to the client.
Why the updt request halt for four seconds ? It seems server process too much data at once, but why?