SLOW DISK: 100MB/s read but only 2MB/s write!
Hi!
I just setup a new server, good machine, and I experience a very slow write speed on the disk although the read is fine. Below are all details. THANK YOU! Custom Kernel 3.14.4-grsec 32bit - Xeon (core-avx2) XFS file systems. DISK: WDC WD1003FBYX-0 CONTROLLER: Intel 8 Series/C220 Series Chipset Family 4-port SATA Controller 1 [IDE mode] Code:
# hdparm -tT /dev/sda Code:
# iotop WHILE READING: (copy big file from disk to ramfs) Code:
# iotop WHILE WRITING: (copy big file from ramfs to disk) Code:
root[www]# hdparm -i /dev/sda |
Forget IDE mode. Go AHCI.
|
Thank you but I'm sorry, I don't see how that could make the disk that slow in writing only!
|
You may also have misaligned partitions.
|
Right, I thought about that, but would the read speed still be so fast? (100MB/s)
|
Quote:
|
Ah. Thank you.
Any thought on that: Code:
# fdisk /dev/sda |
Quote:
Just to be sure the problem is really with the drive, turn off swap temporarily and try writing from /dev/zero to the swap partition. Code:
swapoff /dev/sda2 && dd if=/dev/zero of=/dev/sda2 bs=1M seek=1 count=10K |
Code:
# swapoff /dev/sda2 && dd if=/dev/zero of=/dev/sda2 bs=1M seek=1 count=10K I had to stop it because it would take forever. During that, I was monitoring with iotop and the overall write speed of the disk never went over 3MB/s, usually 1-2MB/s. |
Quote:
|
Quote:
And now that I notice the results in #9, I can only conclude that something seems seriously wrong with that drive. That test was doing I/O to a properly aligned partition. Let's see the output from "smartctl -A /dev/sda" and see if that reveals anything. |
Well, that leaves IDE mode which should never be used with any POSIX compliant OS.
|
Code:
# smartctl -A /dev/sda . |
System uptime is irrelevant. The drive accumulates those events internally whenever it is on.
Well, I'm at a loss to explain what is happening. Those SMART attributes all look excellent -- no bad sectors, nothing out of the ordinary. Unless some other process is pounding on the disk or /var/log/messages is overflowing with ATA error messages, I can't imagine what could be going on. Even if there were an alignment issue (which has been ruled out anyway), a 50:1 degradation would be beyond anything I've heard about. This is an ordinary internal disk, not part of some network storage or RAID array, right? By any chance is the BIOS set up for RAID, and writes are always waiting for a missing disk in the array? Or, perhaps everything you write to the disk is first being sent to the NSA for inspection/audit?? :rolleyes: |
Alright. I'm trying one more time. IDE mode is compatibility mode for Windows XP users so they can boot and install AHCI drivers. Quite clear it is not designed for performance ... ?
|
|
Hmm... I have no access to the BIOS, I am asking the hosting company.
This is a real HDD connected to physical sata. There is no crazy writing to /var/log, and we would see it in iotop. I don't believe there is any expected RAID drive because I had another disk connected temporary when I installed the server and that resulted in 2 distinct drives (did not pay attention to speed at that moment, except that I did find the copy pretty long) |
ok you won't believe that...
As I previously said, I had a mysterious crash a few hours ago so the uptime was about 6h. Well... Since that reboot, write speed is now 50MB/s ... Since there is absolutely nothing in any log about that, that means: - either my hosting company wants to get rid of my ticket and realized a mistake of them, unplugged the power and fixed the problem, then the customer doesn't know what happened and things work again. (that would be the paranoid perspective though) - or that drive is really unreliable and dangerous because my system directories are loaded in ramfs read-only at boot, so nothing changed at all for sure. I still believe that a such drive could to better than 90MB/s read and 50MB/s write. So I requested another drive and I also recompiled my kernel for ahci support and they will enable it in the BIOS. I will work on that at 4am tomorrow :) |
SMART is pretty good about keeping a record of misbehavior by the drive. Until the drive is replaced, you could look at "smartctl -l error /dev/sda" and see if any internal problems were logged.
You had built a kernel without AHCI support?? :rolleyes: |
Ah, good,
No errors logged. Yes, I always compile the most optimized possible kernel on my servers, and since the BIOS did not have AHCI, I disabled it. But it's alright, just 5min to go check to option in .config and recompile. So I have a second drive plugged in now, and both read & write speeds are 130MB/s with AHCI. :) |
All right, so to summarize, in case someone finds this topic,
- hard drive or cable probably had some hardware issues. - rebooting stopped the problem for a while (writing speed was suddenly about 50MB/s, but problem came back after writing on the drive intensively) - AHCI seems to help but does not justifies a 2-3MB/s. - My tests on a new IDENTICAL drive shown 130MB/s both for read and write. Topic solved. Thanks again to everyone for your help! :))) Best! |
All times are GMT -5. The time now is 08:23 AM. |