0

I am working on a Server which called a datasource parallely for different queries, takes up the data in memory, aggregates it and responds back. I have 4 cores. Till the time i was having 4 queries, my latency was normal, but since the time I have added 5th one, it's taking almost double the time. Also, the 5th Query is the quickest of all.

Ideally my CPU should not block on the IO of all the four to process the fifth one. But I wanted to understand when exactly does my CPU get blocked on IO.

  1. Does it get blocked when my server is receiving the response, but has not received it fully?
  2. Does it get blocked when my server has received the response and is parsing it? I believe it does.
Sandeep Kaul
  • 2,957
  • 2
  • 20
  • 36
  • Parsing won't *block* the CPU; it *uses* the CPU. – Scott Hunter May 29 '19 at 17:00
  • 2
    If a process is I/O blocked, the kernel will just set it aside (put it in the "waiting" state) and not even consider giving it time in the CPU. When the I/O has finished, the kernel moves the blocked process from the "waiting" state to the "ready" state so it can have its turn ("running") in the CPU. Please refer to the below thread. https://stackoverflow.com/questions/35688553/does-a-thread-waiting-on-io-also-block-a-core – Srikanth J May 29 '19 at 17:03
  • What do we mean by IO has finished. Have I collected the response from the server, have I parsed it? – Sandeep Kaul May 29 '19 at 17:16

0 Answers0