我在我的服务器上监视我的磁盘,因为我的网站很慢。
这是我的磁盘统计信息:
读取:0.29 请求/秒 写入:50.19 请求/秒
我不明白为什么我的磁盘上每秒有 50 个书面请求。
我怎样才能找到写得像猪的程序?命令行 ?程序 ?
更新:服务器是一个 debian etch。该磁盘位于 SAN 中,因此它是一个虚拟磁盘。
我的数据库是 mysql,我的网站是 ruby on rails。
我有 1 GB 内存。
下面是 free 命令的结果:
free -m
total used free shared buffers cached
Mem: 995 769 225 0 46 421
-/+ buffers/cache: 301 693
Swap: 1906 0 1906
我不认为是交换问题。我不明白 :(
好的,经过几次搜索,我发现:
Postfix 在我的 syslog 文件中按秒添加 10 个条目:s,日志是这样的:
Feb 16 10:51:41 myhost postfix/local[24480]: 333902F1CE: to=<[email protected]>, orig_to=<root>, relay=local, delay=73, delays=42/25/0/6.1, dsn=5.1.1, status=bounced (unknown user: "ovh")
Feb 16 10:51:41 myhost postfix/qmgr[3753]: 528032F1D3: removed
Feb 16 10:51:41 myhost postfix/cleanup[24624]: CEBAD2F1D4: message-id=<[email protected]>
Feb 16 10:51:41 myhost postfix/bounce[24575]: B8EE32F19B: sender non-delivery notification: DDE2D2F1DE
Feb 16 10:51:41 myhost postfix/qmgr[3753]: DDE2D2F1DE: from=<>, size=2798, nrcpt=1 (queue active)
Feb 16 10:51:41 myhost postfix/cleanup[25934]: 659B02F1D3: message-id=<[email protected]>
Feb 16 10:51:41 myhost postfix/qmgr[3753]: B8EE32F19B: removed
Feb 16 10:51:41 myhost postfix/local[24948]: DDE2D2F1DE: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=15, delays=12/2/0/1.3, dsn=5.1.1, status=bounced (unknown user: "ovh")
Feb 16 10:51:41 myhost postfix/bounce[24726]: 333902F1CE: sender non-delivery notification: 659B02F1D3
Feb 16 10:51:41 myhost postfix/qmgr[3753]: CEBAD2F1D4: from=<[email protected]>, size=983, nrcpt=1 (queue active)
Feb 16 10:51:41 myhost postfix/qmgr[3753]: 333902F1CE: removed
Feb 16 10:51:41 myhost postfix/qmgr[3753]: 659B02F1D3: from=<>, size=2792, nrcpt=1 (queue active)
Feb 16 10:51:41 myhost postfix/qmgr[3753]: DDE2D2F1DE: removed
Feb 16 10:51:47 myhost postfix/local[24480]: 659B02F1D3: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=8.7, delays=3.3/0/0/5.4, dsn=5.1.1, status=bounced (unknown user: "ovh")
Feb 16 10:51:47 myhost postfix/local[25978]: CEBAD2F1D4: to=<[email protected]>, orig_to=<root>, relay=local, delay=32, delays=27/0/0/5.4, dsn=5.1.1, status=bounced (unknown user: "ovh")
Feb 16 10:51:47 myhost postfix/qmgr[3753]: 659B02F1D3: removed
Feb 16 10:51:47 myhost postfix/cleanup[24906]: 1A7512F19B: message-id=<[email protected]>
Feb 16 10:51:53 myhost postfix/bounce[24726]: CEBAD2F1D4: sender non-delivery notification: 1A7512F19B
Feb 16 10:51:53 myhost postfix/qmgr[3753]: CEBAD2F1D4: removed
Feb 16 10:51:53 myhost postfix/qmgr[3753]: 1A7512F19B: from=<>, size=2798, nrcpt=1 (queue active)
Feb 16 10:51:59 myhost postfix/local[24948]: 1A7512F19B: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=12, delays=6.2/0/0/6.1, dsn=5.1.1, status=bounced (unknown user: "ovh")
Feb 16 10:51:59 myhost postfix/qmgr[3753]: 1A7512F19B: removed
Feb 16 10:52:11 myhost /USR/SBIN/CRON[25984]: (root) CMD (/usr/local/rtm/bin/rtm 18 > /dev/null 2> /dev/null)
Feb 16 10:52:11 myhost /USR/SBIN/CRON[25985]: (root) CMD (wget -O /dev/null http://monsite.com/cron/desactive_arene)
Feb 16 10:52:16 myhost /USR/SBIN/CRON[25987]: (root) CMD (run-parts /usr/local/oco/bin/60sec >/dev/null 2>/dev/null)
Feb 16 10:52:22 myhost /USR/SBIN/CRON[25988]: (root) CMD (run-parts /usr/local/oco/bin/120sec >/dev/null 2>/dev/null)
Feb 16 10:52:39 myhost postfix/pickup[23034]: 8A8CC2F1BD: uid=0 from=<root>
Feb 16 10:52:44 myhost postfix/cleanup[24624]: 8A8CC2F1BD: message-id=<[email protected]>
Feb 16 10:52:44 myhost postfix/qmgr[3753]: 8A8CC2F1BD: from=<[email protected]>, size=983, nrcpt=1 (queue active)
Feb 16 10:52:44 myhost postfix/local[24480]: 8A8CC2F1BD: to=<[email protected]>, orig_to=<root>, relay=local, delay=21, delays=15/0/0/6.1, dsn=5.1.1, status=bounced (unknown user: "ovh")
在这里,我不明白发生了什么。
除了
iotop
上述建议之外,您没有在某处启用 LOG_ALL,对吗?其他可能有用的提示:
如果是最近的 linux 机器,iotop 是您要运行的程序。