req := &mystruct{}
json.NewDecoder(r.Body).Decode(req)


We've instrument the above code block and reading request body bytes is 
taking very long i.e., upto 5 secs sometimes reaching upto 20 seconds at 
the throughput of ~4-5K RPM

The Request Body Size Metrics are as follows

Average: 73190 Bytes
90th percentile: 170862 Bytes
99th percentile: 467638 Bytes

Tried ioutil.ReadAll too. But, the read time is same. We're not sure why 
it's so very slow on production with HIGH BANDWIDTH Network line.

Also, there are 5% of errors in this API with following errors while 
decoding json data

   1. unexpected EOF
   2. Error in decoding request: read tcp 127.0.0.1:8080->127.0.0.1:48896: 
   i/o timeout

We're using Kubernetes with Istio 1.0.5 on GCP. These errors are probably 
from Envoy Sidecar, but since the Envoy acts as a reverse proxy, not sure 
why we can get EOF or Timeout Errors since end user connection terminates 
at proxy itself.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/871e3230-a4f3-4469-8aaf-a8e3b6f49e73%40googlegroups.com.

Reply via email to