title: 0 iowait on a io-intensive application. What my cpu spent time on?
body: <p>I did a test on my VM.
  It's a simple while-true loop to insert data into MySQL installed on the same machine.</p>
  
  <p>When the code is running, I noticed it make 50% CPU in us, and 50% id, 0 wa.</p>
  
  <p>I think the bottle neck is disk IO. Looking forward to get a high <code>wa</code> in <code>top</code>. But the fact, I got 0 on <code>wa</code> and 50 <code>idle</code>.<br>
  I guess it's may because disk cache, but I don't know how to prove my idea.</p>
  
  <p>I don't know why there's 50% idle and what to do to improve the performance.<br>
  Is there something I missed or can do further?</p>
  
  <p>the output of <code>top</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/Ir2bd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ir2bd.png" alt="enter image description here"></a></p>
  
  <p>the output of <code>iotop</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/C48uH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C48uH.png" alt="enter image description here"></a></p>