title: Mysql - query is slow when IO on linux server wait is high
body: <p>Slow query when IO wait is high.</p>
  
  <blockquote>
    <p><strong>Show from iotop command</strong></p>
    
    <p>-- TID -- PRIO -- USER -- DISK READ -- DISK WRITE -- SWAPIN -- IO> -- COMMAND</p>
    
    <p>-- 2311 -- be/4 -- mysql -- 0.00 B/s --  0.00 B/s -- 0.00% -- 96.25% -- mysql~l.sock</p>
    
    <p>-- 2311 -- be/4 -- mysql -- 0.00 B/s --  0.00 B/s -- 0.00% -- 96.25% -- mysql~l.sock</p>
    
    <p>-- 2311 -- be/4 -- mysql -- 0.00 B/s --  0.00 B/s -- 0.00% -- 96.24% -- mysql~l.sock</p>
    
    <p><strong>High IO wait start when 6:13:28 PM - 6:13:29 PM (sar command)</strong></p>
    
    <p>--------------------- CPU -- %usr -- %nice -- %sys -- %iowait -- %steal</p>
    
    <p>-- 6:13:28 PM --- all ----- 2.53 --- 0.00 ---- 2.02 ----- <strong>39.39</strong> ------ 0.00</p>
    
    <p>-- 6:13:29 PM --- all ----- 1.99 --- 0.00 ---- 1.00 ----- <strong>49.25</strong> ------ 0.00</p>
    
    <p><strong>Got slow query between that time</strong></p>
    
    <p>Time: 130329 18:13:29</p>
    
    <p>User@Host: wdwdwd[wdwdwd] @ localhost []</p>
    
    <p>Query_time: 2.007902  Lock_time: 0.000025 Rows_sent: 0  Rows_examined: 1 SET timestamp=1364555609; </p>
    
    <p>UPDATE log_product SET credit=credit+1 WHERE id_product='349721228' and id_user='2021841' LIMIT 1;</p>
    
    <p><strong>## Question are How to fix this process. What the real cause ? ##</strong></p>
  </blockquote>