Centos – Disk access slow

centoshard drive

I have a process running in a CentOS 6.3 server. When logging is turned on, the process slows down drastically. The logs are being written to /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

How do I figure out what is wrong here? And how to fix this? Thanks.

Edit:
lshw output:

[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

Best Answer

You haven't told us what the process is doing and if the process is writing to the same disk you are also logging to. If so, it shouldn't be a shock that writing to the same disk with the logging is going to slow the process that is also writing to disk. IF it is only a single spindle with what looks like an ATA disk spinning at likely 7.2k, you would be even more constrained by the number of IOPS that the single spindle can handle.

edit: The hdparm output also seems to indicate that your drive is running in PIO 0 mode and that DMA mode is not supported. DMA mode transfers should be faster, if it is really running in PIO mode 0, you are running the the slowest mode possible for the ATA interface.

Related Topic