LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 09-14-2010, 11:19 AM   #1
eltonsky
LQ Newbie
 
Registered: Sep 2010
Posts: 11

Rep: Reputation: 0
Sata disk write speed is very slow!


hello forumers,

I got a new machine with GA-p55A-ud3 mobo and a WDC WD10EARS 1T disk. When I tried to benchmark the disk IO, I was suprised by the low write speed:

[Children see throughput for 1 initial writers = 35962.63 KB/sec
Parent sees throughput for 1 initial writers = 35962.63 KB/sec
Min throughput per process = 35962.63 KB/sec
Max throughput per process = 35962.63 KB/sec
Avg throughput per process = 35962.63 KB/sec
Min xfer = 2048000.00 KB

Children see throughput for 1 rewriters = 42461.44 KB/sec
Parent sees throughput for 1 rewriters = 42461.44 KB/sec
Min throughput per process = 42461.44 KB/sec
Max throughput per process = 42461.44 KB/sec
Avg throughput per process = 42461.44 KB/sec
Min xfer = 2048000.00 KB
]

Just 35 ~ 42 MB/s. I installed debian lenny 2.6.26 and I suspected maybe this is because I am using old kernel. So I compiled a 2.6.32.21 and reboot.
However, the result is still the same.
Why is this?

The related output from my lspci:
00:1f.2 SATA controller: Intel Corporation Ibex Peak 6 port SATA AHCI Controller (rev 06)

The related output from my dmesg:
[ 2.182356] ahci 0000:00:1f.2: version 3.0
[ 2.182365] ahci 0000:00:1f.2: PCI->APIC IRQ transform: INT B -> IRQ 19
[ 2.188038] ahci 0000:00:1f.2: irq 28 for MSI/MSI-X
[ 2.188060] ahci: SSS flag set, parallel bus scan disabled
[ 2.209290] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
[ 2.221870] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pmp pio slum part ems apst
[ 2.235972] ahci 0000:00:1f.2: setting latency timer to 64
[ 2.273292] scsi0 : ahci
[ 2.280626] scsi1 : ahci
[ 2.287984] scsi2 : ahci
[ 2.295374] scsi3 : ahci
[ 2.302491] scsi4 : ahci
[ 2.309338] scsi5 : ahci
[ 2.403150] ahci 0000:02:00.0: PCI->APIC IRQ transform: INT A -> IRQ 16
[ 2.411320] ahci 0000:02:00.0: irq 29 for MSI/MSI-X
[ 2.425344] ahci 0000:02:00.0: AHCI 0001.0200 32 slots 8 ports 6 Gbps 0xff impl SATA mode
[ 2.441704] ahci 0000:02:00.0: flags: 64bit ncq pio
[ 2.450182] ahci 0000:02:00.0: setting latency timer to 64
[ 2.450442] scsi6 : ahci
[ 2.458744] scsi7 : ahci
[ 2.466789] scsi8 : ahci
[ 2.474597] scsi9 : ahci
[ 2.482142] scsi10 : ahci
[ 2.489388] scsi11 : ahci
[ 2.496294] scsi12 : ahci
[ 2.502870] scsi13 : ahci

The related output from my lshw:
*-storage
description: SATA controller
product: Ibex Peak 6 port SATA AHCI Controller
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
logical name: scsi0
version: 06
width: 32 bits
clock: 66MHz
capabilities: storage msi pm ahci_1.0 bus_master cap_list emulated
configuration: driver=ahci latency=0 module=ahci
*-disk:0
description: ATA Disk
product: WDC WD10EARS-00Y
vendor: Western Digital
physical id: 0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: 80.0
serial: WD-WCAV5D367278
size: 931GiB (1TB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=0008598f
...

Any idea will be appricated.
Thanks
 
Old 09-14-2010, 11:51 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,309

Rep: Reputation: 139Reputation: 139
What tools are you using to benchmark disk IO and what filesystem is on the disk? What do you get with:

# hdparm -t /dev/sda

Edit: I guess you are not alone:

http://community.wdc.com/t5/Desktop/...slow/td-p/7581

I think problem is these Caviar Green "EARS" drives apparently use Advanced Format Technology (AF), i.e. the sector size on the drive is 4K instead of the standard 512 bytes:

http://en.wikipedia.org/wiki/Advanced_Format

and:

http://wdc.com/en/products/products.asp?driveid=763

From my limited googling, WD does not support AF on linux. Very poor performance is reported if the drive partition boundaries are not aligned with the 4K sectors. There are some workarounds to insure proper alignment using fdisk to create the partitions:

http://www.linuxquestions.org/questi...drives-792046/

http://notepad.patheticcockroach.com...mac-os-part-1/

and:

http://notepad.patheticcockroach.com...-linux-part-2/

You probably want to google "Western Digital Advanced Format linux fdisk" to get more detailed info.

Last edited by kilgoretrout; 09-14-2010 at 01:40 PM.
 
Old 09-15-2010, 02:56 AM   #3
eltonsky
LQ Newbie
 
Registered: Sep 2010
Posts: 11

Original Poster
Rep: Reputation: 0
kilgoretrout, Thanks for reply.
I am using iozone.

And it's helpful when I set the first partition's starting sector to 64. The write rate climbs to 72MB/s!

But now I think I got another problem. I have 2 partitions on this disk. And the interesting thing is the write performance of the second partition is lower than the first one.
Here is result of fdisk -l - u :

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0003e835

Device Boot Start End Blocks Id System
/dev/sdd1 64 976751999 488375968 83 Linux
/dev/sdd2 976752000 2197708064 610478032+ 83 Linux

For /dev/sdd1, write speed is around 70MB/s. But for /dev/sdd2 only 60MB/s. I do tested a few times.
Any idea on this?
 
Old 09-15-2010, 04:14 AM   #4
jim_p
Member
 
Registered: Aug 2009
Distribution: Debian testing
Posts: 481

Rep: Reputation: 108Reputation: 108
WD green hdds, and especially the EARS series, are known to be slow. I assume yours is unalligned too.
You won't gain much after allignment though...

Here, see for yourself
http://www.xbitlabs.com/articles/sto...roundup-3.html

Some say that the drive has to be formatted under windows 7, so that alignment is done automatically. If you dont have windows 7, gparted 0.6.0+ can do the same thing on any filesystem.
 
Old 09-15-2010, 04:28 AM   #5
eltonsky
LQ Newbie
 
Registered: Sep 2010
Posts: 11

Original Poster
Rep: Reputation: 0
jim_p,

PHP Code:
Disk /dev/sdd1000.2 GB1000204886016 bytes
255 heads
63 sectors/track121601 cylinderstotal 1953525168 sectors
Units 
sectors of 1 512 512 bytes
Disk identifier
0x0003e835

Device Boot Start End Blocks Id System
/dev/sdd1 64 976751999 488375968 83 Linux
/dev/sdd2 976752000 2197708064 61047803283 Linux 
From above, you can see /dev/sdd2 starts from 976752000, which is aligned with 4K segment I assume.

is this right?
 
Old 09-15-2010, 06:49 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,579
Blog Entries: 2

Rep: Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036
Its just physics, as the harddrive is spinning at a constant angular velocity it must be slower the more you get to the inner tracks.
 
Old 09-15-2010, 07:48 AM   #7
eltonsky
LQ Newbie
 
Registered: Sep 2010
Posts: 11

Original Poster
Rep: Reputation: 0
That makes sense, thank you!
 
Old 09-15-2010, 11:42 AM   #8
jim_p
Member
 
Registered: Aug 2009
Distribution: Debian testing
Posts: 481

Rep: Reputation: 108Reputation: 108
That angular velocity speed thing has to be the most stupid excuse for poor performance.
At the above test, why don't the other drives from the other manifacturers have/suffer from the same physics "problem"?

If you take a look at the rar extraction test for instance, the ears drive is like... 10 times slower!
http://www.xbitlabs.com/articles/sto..._17.html#sect0

@eltonsky
I think that this line tells that your disk is unaligned
Code:
Units = sectors of 1 * 512 = 512 bytes
If you don't have data on it, consider a format that will do the alignment.

Also have a look at this thread on wd forums. This is where it all started
http://community.wdc.com/t5/Desktop/...razy/td-p/1547
 
Old 09-16-2010, 12:01 AM   #9
eltonsky
LQ Newbie
 
Registered: Sep 2010
Posts: 11

Original Poster
Rep: Reputation: 0
jim_p,

The
"
Units = sectors of 1 * 512 = 512 bytes
"

means the logic sector size in my system is 512bytes. But from

Quote:
Device Boot Start End Blocks Id System
/dev/sdd1 64 976751999 488375968 83 Linux
/dev/sdd2 976752000 2197708064 610478032+ 83 Linux
you can see /dev/sdd1 starts from sector 64, /dev/sdd2 starts from sector 976752000. Both of them are multiples of 8.

Does this mean these 2 partitions are aligned?
 
Old 09-16-2010, 06:07 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,579
Blog Entries: 2

Rep: Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036Reputation: 4036
Quote:
Originally Posted by jim_p View Post
That angular velocity speed thing has to be the most stupid excuse for poor performance.
If you have read the post I was answering two you would know that the angular velocity explanation was not meant to explain overall poor performance, but to explain why the harddrive is not transfering data at the same speed over the whole disk.
Should read carefully before calling something stupid.
If you had carefully read the article at xbit you also would know that the EARS drives work only internally with 4K units but act externally as drives with 512 byte units. Therefore it is essential that you align partitions to sectors that are dividable by 8. This is exactly done by th OP, his drives partitions are aligned.
 
  


Reply

Tags
ahci, sata


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Write Speed to USB Flash Drives rdsherman Linux - Hardware 1 09-14-2009 03:23 PM
WD sata slow speed khaleel5000 Linux - Hardware 28 04-24-2008 08:55 AM
NF7-S + Sata .... extremely slow speed... Ryanlee Linux - Hardware 1 11-02-2005 12:57 AM
Disk write speed occuda Linux - Newbie 12 06-21-2005 11:36 PM
Slow RAID write speed in RH9 Phaethar Linux - Hardware 0 12-09-2003 10:26 AM


All times are GMT -5. The time now is 07:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration