you could try ffjson https://github.com/pquerna/ffjson
On Tuesday, April 28, 2020 at 12:49:08 PM UTC-4, Sarath Prabath Redlapalli
Jaya wrote:
>
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/3cf4cb1d-cf8d-4eef-89f7-ba9f9fbb300e%40googlegroups.com.