I/O这么差,难道我的硬盘要坏了?
I/O这么差,难道我的硬盘要坏了?你们执行这个命令试试
dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
我的用的是 MagicLinux 2.5.6 CD
--------------------------------------------------------------------
$ dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
3072+0 records in
3072+0 records out
201326592 bytes (201 MB) copied,108.302 秒,1.9 MB/秒
$
[ 本帖最后由 pps 于 2011-1-29 20:23 编辑 ] 你把后面的参数去掉试试 :-Ddd if=/dev/zero of=test----------------------------------------
$ dd if=/dev/zero of=test
^C记录了425330+0 的读入
记录了425330+0 的写出
217768960字节(218 MB)已复制,3.10457 秒,70.1 MB/秒 dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
这个命令我在VPS上测试都得30-70MB/s 原帖由 pps 于 2011-1-29 20:23 发表 http://www.linuxfans.org/bbs/images/common/back.gif
dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
这个命令我在VPS上测试都得30-70MB/s
服务器怎么能和pc机比较呢.....
我这条命令也只有 2MB/s :mrgreen: 我一台04年的服务器+fedora13/x86_64,也不过7M而已。
回复 4# nihui 的帖子
dd if=/dev/zero of=test bs=64k count=3k oflag=dsync是什么意思?我的测试结果是
3072+0 records in
3072+0 records out
201326592 bytes (201 MB) copied,14.5791 秒,13.8 MB/秒
没有你说的那么差呀,只是用80GB,7200转的IDE硬盘。
[ 本帖最后由 软用者 于 2011-1-30 09:59 编辑 ] bs=64k 块大小为64k
count=3k 一共复制3k个块
oflag=dsync 直接IO不使用缓冲
不过我这边确实是2MB/s,我没有看错。 我的电脑上装有ML2.5.6和win xp
在win xp的vmware虚拟机里面的centos5.5使用这条命令
dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
我的测试结果是
3072+0 records in
3072+0 records out
201326592 bytes (201 MB) copied,8.88851秒,22.7MB/秒
测试过多次,值平均在23MB/秒
MagicLinux 2.5.6 CD 才1.9 MB/秒
差距咋这么大呢 难道 nihui和 楼上一样是用haulm搞出来的系统?顺便说句,我这样说请 haulm不要见怪。 dd if=/dev/zero of=test bs=64k count=3k oflag=dsync
3072+0 records in
3072+0 records out
201326592 bytes (201 MB) copied,124.166 秒,1.6 MB/秒 检查内核设置,主要是硬盘控制器驱动。
硬盘和控制器工作在pio兼容模式就这个速度。 cat /boot/config-2.6.36.3|grep PIO|sed /#/d
CONFIG_GENERIC_GPIO=y
CONFIG_B43_PIO=y
CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
CONFIG_SCx200_GPIO=m
CONFIG_PC8736x_GPIO=m
CONFIG_NSC_GPIO=m
CONFIG_CS5535_GPIO=m
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_MAX730X=m
CONFIG_GPIO_MAX732X=m
CONFIG_GPIO_PCA953X=m
CONFIG_GPIO_PCF857X=m
CONFIG_GPIO_MAX7301=m
CONFIG_GPIO_MCP23S08=m
CONFIG_PCF50633_GPIO=m
你希望怎么改? cat /boot/config-2.6.36.3|grep DMA|sed /#/d
CONFIG_ZONE_DMA=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_ISA_DMA_API=y
CONFIG_BLK_DEV_IDEDMA_SFF=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_PDC_ADMA=y
CONFIG_ATA_BMDMA=y
CONFIG_PATA_OPTIDMA=y
CONFIG_IEEE1394_SBP2_PHYS_DMA=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
CONFIG_CARDMAN_4000=m
CONFIG_CARDMAN_4040=m
CONFIG_VIDEOBUF_DMA_SG=m
CONFIG_SND_DMA_SGBUF=y
CONFIG_HAS_DMA=y cat /boot/config-2.6.36.3|grep DMA|sed /^C/d
# CONFIG_NEED_DMA_MAP_STATE is not set
# CONFIG_ZONE_DMA32 is not set
# CONFIG_DMAR is not set
# SFF controllers with custom DMA interface
# SATA SFF controllers with BMDMA
# PATA SFF controllers with BMDMA
# CONFIG_PATA_HPT3X3_DMA is not set
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_SOUND_DMAP is not set
# CONFIG_DMADEVICES is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set
# CONFIG_DMA_API_DEBUG is not set
cat /boot/config-2.6.36.3|grep PIO|sed /^C/d
# CONFIG_MTD_GPIO_ADDR is not set
# PIO-only SFF controllers
# CONFIG_MDIO_GPIO is not set
# CONFIG_8139TOO_PIO is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_SPI_GPIO is not set
# Memory mapped GPIO expanders:
# CONFIG_GPIO_IT8761E is not set
# CONFIG_GPIO_SCH is not set
# I2C GPIO expanders:
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_SX150X is not set
# CONFIG_GPIO_ADP5588 is not set
# PCI GPIO expanders:
# CONFIG_GPIO_CS5535 is not set
# CONFIG_GPIO_LANGWELL is not set
# CONFIG_GPIO_RDC321X is not set
# SPI GPIO expanders:
# CONFIG_GPIO_MC33880 is not set
# AC97 GPIO expanders:
# MODULbus GPIO expanders:
# CONFIG_W1_MASTER_GPIO is not set
# CONFIG_MFD_SM501_GPIO is not set
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_TRIGGER_GPIO is not set 内核参数是继承的,按照内核默认增加新的特性,可能一些新的特性不会做为方向吸收进内核,如果需要改变内核的基本配置可能对老机器也会有影响,如果你有好的参数构架可以提出来。