我在 CentOS 6.3 服务器上运行一个进程。当启用日志记录时,该进程的速度会急剧下降。日志被写入 /tmp
[root@localhost src]# hdparm -I /dev/sda
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0d 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ATA device, with non-removable media
Standards:
Likely used: 1
Configuration:
Logical max current
cylinders 0 0
heads 0 0
sectors/track 0 0
--
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 0 MBytes
device size with M = 1000*1000: 0 MBytes
cache/buffer size = unknown
Capabilities:
IORDY not likely
Cannot perform double-word IO
R/W multiple sector transfer: not supported
DMA: not supported
PIO: pio0
[root@localhost src]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
51606140 6267948 42716752 13% /
tmpfs 8141564 1016 8140548 1% /dev/shm
/dev/sda3 495844 37728 432516 9% /boot
/dev/mapper/VolGroup-lv_home
1090839440 1022652 1034405284 1% /home
我如何找出这里的问题?如何修复它?谢谢。
编辑:lshw 输出:
[root@localhost src]# ./lshw -class disk
*-disk
description: SCSI Disk
product: PERC H310
vendor: DELL
physical id: 2.0.0
bus info: scsi@0:2.0.0
logical name: /dev/sda
version: 2.12
serial: 00677e1515fc98ef19000d93f7a0a38c
size: 1117GiB (1199GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=31c27a66
答案1
您没有告诉我们该进程正在做什么,以及该进程是否正在写入您也正在记录的同一磁盘。如果是这样,那么写入与记录相同的磁盘会减慢写入磁盘的进程的速度,这应该不足为奇。如果它只有一个主轴,看起来像一个 ATA 磁盘,转速可能为 7.2k,那么您将受到单个主轴可以处理的 IOPS 数量的更多限制。
编辑:hdparm 输出似乎还表明您的驱动器正在 PIO 0 模式下运行,并且不支持 DMA 模式。DMA 模式传输应该更快,如果它确实在 PIO 模式 0 下运行,则您正在运行 ATA 接口可能最慢的模式。