On Tue, Apr 28, 2020 at 6:48 PM Sarath Prabath Redlapalli Jaya <
harrysarath2...@gmail.com> wrote:

> 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
>
>
Let us assume we have 500 kilobytes of data. At 20 seconds processing time,
you are looking at something like 25 bytes per millisecond, which seems
rather low for a decent CPU. Try measuring the time it takes to
ioutil.ReadAll from the Reader I assume you have access to. My hunch is you
are spending most of the time there, and relatively little on decoding the
JSON data you have. Once you've done this, you will have some more
knowledge of where to look: the network, or the JSON decoder.

If this is a web request, you should also look at how time it takes the
other end to feed data to the GCP process. Chances are that the problem is
in the other end, and you are looking at a slow sender, especially if you
have a large set of mobile devices out there with variety in their internet
connections.

-- 
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/CAGrdgiWYeMuFvV-kO4kYDQbVHKCHKw%3D4A13PSPKCywiDfn2L%3DQ%40mail.gmail.com.

Reply via email to