Linux伺服器高I/O等待延遲問題尋找

來源:互聯網
上載者:User

Linux伺服器高I/O等待延遲問題尋找

0. 首先是top查看一下系統狀況

發現兩個參數異常,一是平均負載高,一是cpu %wa一直在50%以上。

查了一下%wa參數的意義:

 
  1. wa -- iowait  
  2.  Amount of time the CPU has been waiting for I/O to complete. 

1. 查看磁碟讀寫資料

用iostat 查看磁碟狀況

 
  1. $ iostat -x 2 5  
  2.  avg-cpu: %user %nice %system %iowait %steal %idle  
  3.   3.66 0.00 47.64 48.69 0.00 0.00  
  4.  
  5.  Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util  
  6.  sda 44.50 39.27 117.28 29.32 11220.94 13126.70 332.17 65.77 462.79 9.80 2274.71 7.60 111.41  
  7.  dm-0 0.00 0.00 83.25 9.95 10515.18 4295.29 317.84 57.01 648.54 16.73 5935.79 11.48 107.02  
  8.  dm-1 0.00 0.00 57.07 40.84 228.27 163.35 8.00 93.84 979.61 13.94 2329.08 10.93 107.02 

2.查看進程狀態

進程狀態表

 
  1. PROCESS STATE CODES  
  2.  D uninterruptible sleep (usually IO)  
  3.  R running or runnable (on run queue)  
  4.  S interruptible sleep (waiting for an event to complete)  
  5.  T stopped, either by a job control signal or because it is being traced.  
  6.  W paging (not valid since the 2.6.xx kernel)  
  7.  X dead (should never be seen)  
  8.  Z defunct ("zombie") process, terminated but not reaped by its parent. 

查看到進程中狀態Ddisk sleep)的進程

 
  1. # for x in `seq 1 1 10`; do ps -eo state,pid,cmd | grep "^D"; echo "----"; sleep 5; done 

查看到有kjournald這個進程

查看這個進程是做什麼的?

kjournald是ext3檔案系統記錄檔案系統日誌的進程。

查看進程相關狀態資訊

 
  1. # cat /proc/487/io  
  2.  rchar: 48752567  
  3.  wchar: 549961789  
  4.  syscr: 5967  
  5.  syscw: 67138  
  6.  read_bytes: 49020928  
  7.  write_bytes: 549961728  
  8.  cancelled_write_bytes: 0 

查看都往哪寫東西了

 
  1. # lsof -p 487 

引起kjournald 狀態D的原因還在查。。。。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.