0

I have a 30GB file on an SSD disk and a process that continuously in a loop reads and writes from/to random locations in the file.

According to IO top, the process consumes almost max read and write IO (40MB/s read, 120MB/s writes, ~95% IO) for ~30 seconds. During those 30 seconds no other process shows any usage of the IO. During that time, while total IO is showing ~120M/s, the actual IO appears to be idle.

Then after 30 seconds kworker appears on top. It shows 0 DISK READ and 0 DISK WRITE, but ~95% IO. It lasts for ~45 seconds, and during those 45 seconds my process also shows ~95% IO, but the read and write speed goes down significantly, to around 2MB/s and 6MBs correspondingly, with high variance. The total IO during this period is close to zero, but the actual IO is now high. After ~45 seconds, kworker disappears, and my process runs at full speed for another 30 seconds.

What is the likely cause of this behavior?

Ishamael
  • 101
  • 3
  • Disk I/O is buffered, in units of "clusters of blocks". The behavior you see is most likely disk buffers filling up and (most) read requests being satisfied by a memory-to-memory transfer from the buffer. `kworker` is "flushing to disk" the data that was in the buffers. – waltinator Aug 05 '20 at 07:14
  • @waltinator thanks, my further experiments show that this is indeed the case! Do you know where I can read more details, and whether the behavior is configurable? – Ishamael Aug 05 '20 at 21:16
  • AskUbuntu is a Question and Answer site, and not a tutorial/conversation site. Asking a 2nd question in the comments is inappropriate. – waltinator Aug 05 '20 at 22:04

0 Answers0