go-graphite / go-carbon

Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister
MIT License
801 stars 126 forks source link

Add gRPC initial win size of 4MB for less latency #514

Closed emadolsky closed 1 year ago

emadolsky commented 1 year ago

The default behavior of go-grpc is to use BDP and update the window accordingly. The default initial window in this mode is 64KB. However, 64KB is way smaller than our desired window size and this probably causes more time needed for streams to reach the desired size. So, we expect to see faster responses for our big messages (majorly renders). We have seen that the streaming phase of gRPC render requests are slower than their counterpart in HTTP, which lead to this tuning. This PR proposes a big initial window (4MB) to reduce the latency observed while using gRPC comparing to HTTP.