2 ms·
>reconnect periodically >Either of these approaches defeats a fundamental gRPC benefit: reusable connections. Let's say the client reconnects every 50 request
by imtringued 6y ago
>reconnect periodically
>Either of these approaches defeats a fundamental gRPC benefit: reusable connections.
Let's say the client reconnects every 50 requests. You have reduced the connection overhead by 98%. Are those last 2% really going to ruin your day?
- EricBurnett 6y agoIt very much depends on your clients and the nature of the traffic they send. For a high-volume client, assuming a default of 100 concurrent streams per connection max, this actually works out to <connection establishment>, <50 parallel requests>, <connection close>. Have to ~quadruple your connection count vs what you could have done on one unfettered connection, and every connection will spend 50% of it's time being established. Some hybrid of count and time might do, e.g. `50 requests AND 1+ minute since establishment`. But it's nuanced - surprisingly hard to find logic that works well in all cases.
- morelisp 6y agoAs a concrete case of what EricBurnett says, we have a service that has a "long" warmup (p99 30ms - you can think of it like loading a symbol table) but then very fast requests once that data is loaded (p99 about 400usec, fast specifically because it can exchange indexes into the shared symbol table and not full data).