Linux檢視系統IO

2021-06-28 02:05:19 字數 1108 閱讀 5295

linux檢視io的工具主要有兩個,iostat(整合於sysstat包中)和iotop。前者經常用於檢視分割槽的io情況,後者常用來檢視每個程序的io占用。

(1)、 iostat

# yum install sysstat

# iostat -x 5    #每隔五秒顯示一次

(2)、iotop

# yum install iotop

# iotop -o  #僅顯示占用io的程序

iotop選項:

–version show program』s version number and exit

-h, –help show this help message and exit

-o, –only only show processes or threads actually doing i/o

-b, –batch non-interactive mode

-n num, –iter=num number of iterations before ending [infinite]

-d sec, –delay=sec delay between iterations [1 second]

-p pid, –pid=pid processes/threads to monitor [all]

-u user, –user=user users to monitor [all]

-p, –processes only show processes, not all threads

-a, –accumulated show accumulated i/o instead of bandwidth

-k, –kilobytes use kilobytes instead of a human friendly unit

-t, –time add a timestamp on each line (implies –batch)

-q, –quiet suppress some lines of header (implies –batch)

-p 指定程序id,顯示該程序的io情況

-u 指定使用者名稱,顯示該使用者所有的程序io情況

參考:

Linux命令lsof檢視當前系統的IO情況

在linux上的lsof命令可以檢視當前系統當前使用的檔案情況,當然也可以檢視網路socket通訊情況。lsof 檢視所有系統io操作 lsof etc passwd 檢視程序對檔案系統的使用 lsof p 檢視指定程序使用的io情況,通常可以使用這個命令檢視程序開啟的檔案。lsof i aaa.b...

linux檢視cpu 記憶體 io 系統負載等

檢視cpu使用情況的命令 vmstat 5 每5秒重新整理一次,最右側有cpu的佔用率的資料 toptop 然後按shift p,按照程序處理器佔用率排序 檢視記憶體使用情況的命令 free 用free命令檢視記憶體占用情況 toptop 然後按shift m,按照程序記憶體佔用率排序 檢視磁碟i ...

iostat檢視系統I O負載

iostat 選項 引數 c 僅顯示cpu使用情況 d 僅顯示裝置利用率 k 顯示狀態以千位元組每秒為單位,而不使用塊每秒 m 顯示狀態以兆位元組每秒為單位 p 僅顯示塊裝置和所有被使用的其他分割槽的狀態 t 顯示每個報告產生時的時間 v 顯示版號並退出 x 顯示擴充套件狀態。次數 顯示報告的次數。...