LINUX 查看进程IO 工具IOTOP

在使用LINUX时经常会遇到系统IO占用很高,系统IO占用可以使用iostat -x 1查看
但很多时候知道磁盘IO负载高,但并不知道是什么程序占用的,是PHP,还是MYSQL,还是其它的,这就不好查看了。iotop工具可以实现
以ubuntu为例:
安装
root@ubuntu111064:~# apt-get install iotop
安装完成后
执行iotop
就可以看到类似top一样的显示

iotop 详细参数:

root@ubuntu111064:~# iotop -h
unable to set locale, falling back to the default locale
Usage: /usr/bin/iotop [OPTIONS]

DISK READ and DISK WRITE are the block I/O bandwidth used during the sampling
period. SWAPIN and IO are the percentages of time the thread spent respectively
while swapping in and waiting on I/O more generally. PRIO is the I/O priority at
which the thread is running (set using the ionice command).

Controls: left and right arrows to change the sorting column, r to invert the
sorting order, o to toggle the –only option, p to toggle the –processes
option, a to toggle the –accumulated option, q to quit, any other key to force
a refresh.

Options:
–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系统可以通过PUTTY软件,使用 SSH连接
下载地址:
http://www.putty.org/
如果是WINDOWS系统可以使用远程桌面登录
具体在XP\WIN7等系统里的开始》运行里打mstsc命令即可调出远程桌面客户端程序,填入云主机IP即可连接。

 

云主机磁盘IO性能测试

YUNVM云主机存储全部采用SAS 15000转的高性能磁盘,每台物理服务器配备8块以上600GB SAS,是普通的SATA磁盘性能所无法比的,以下是一台普通的VM1024云主机测试数据:
磁盘写入速度达到57.0 MB/s,读取速度达到219 MB/s

root@ubuntu-10:/data# dd if=/dev/zero of=test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 18.8391 s, 57.0 MB/s

root@ubuntu-10:/data# dd of=/dev/zero if=test bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 4.89805 s, 219 MB/s