Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Slow _actual_ disk performance, ok according to hdparm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Fri Aug 02, 2013 2:03 pm    Post subject: Slow _actual_ disk performance, ok according to hdparm Reply with quote

I believe I have a problem with my disk performance. According to hdparm, I should be able to get about 85 MBps.
Code:
weirdwolf ~ # hdparm -t /dev/sdb

/dev/sdb:
 Timing buffered disk reads: 262 MB in  3.02 seconds =  86.81 MB/sec

However, when I for example copy a large file to the disk, I cannot get more than about 9 MBps. Why?

I know the 85 MBps are obtained when reading, not when writing, but 9 MBps still feels way too slow.
It's a dedicated disk (no other partitions), and I get the same results with both ext3, ext4 and xfs. I have really no clue where to start troubleshooting, any help would be welcome!
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Aug 02, 2013 2:29 pm    Post subject: Reply with quote

Run "mount" - how does it show the partition mounted? Using the unwise "sync" option?
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Fri Aug 02, 2013 2:38 pm    Post subject: Reply with quote

No sign of sync..
Code:
weirdwolf ~ # mount
rootfs on / type rootfs (rw)
/dev/sda1 on / type ext4 (rw,noatime,commit=0)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=506054,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda3 on /home type xfs (rw,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nodev,noexec,nosuid)
/dev/sdb1 on /mnt/wddisk type ext4 (rw,noatime,noexec,nosuid,nodev,user)

_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Fri Aug 02, 2013 9:28 pm    Post subject: Reply with quote

PanzerKanzler,

Please tell the drive part number, how its connected and show its fdisk -l output.

I suspect a misaligned 'Advanced Format' drive.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Fri Aug 02, 2013 11:40 pm    Post subject: Reply with quote

I believe WDBKXH5000ABK-01 is the part number.
The relevant part of fdisk -l:
Code:
Disk /dev/sdb: 500.1 GB, 500074283008 bytes, 976707584 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004a183

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   976707583   488352768   83  Linux


Perhaps I should have mentioned that the disk is connected via USB 3.0. However, I don't believe that this is what causes it, since all my other removable media (USB) have decent write speeds.
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sat Aug 03, 2013 2:31 pm    Post subject: Reply with quote

PanzerKanzler,

Your fdisk confirms that your partition alignment is correct for Advanced Format hard drives.
Thats harmlesss even if the drive lies about its physical sector size - many do.

USB3 needs a special USB3 cable - it uses differential signalling so has twice as many wires.
If you use a normal USB cable, at best you get USB2 data rates ... say around 25Mb sec.

How is your USB3 device tree set up?
Which driver are you using in the kernel?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Sat Aug 03, 2013 3:19 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Your fdisk confirms that your partition alignment is correct for Advanced Format hard drives.
Thats harmlesss even if the drive lies about its physical sector size - many do.

Ok, this is good to hear.

NeddySeagoon wrote:
USB3 needs a special USB3 cable - it uses differential signalling so has twice as many wires.
If you use a normal USB cable, at best you get USB2 data rates ... say around 25Mb sec.

I'm using the cable that came with the disk, and it is supposed to be a USB3 cable.
My USB2 memory stick achieves about 18 MBps (it was advertised as 20 MBps) when writing, so even if the disk for some reason decided to use USB2 mode, it should write more than 9 MBps..

NeddySeagoon wrote:
How is your USB3 device tree set up?

How can I find out? (I don't even know what a USB device tree is..)

NeddySeagoon wrote:
Which driver are you using in the kernel?

I'm using the xhci_hcd driver, and not as a module. From lspci -v:
Code:

...

02:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03) (prog-if 30 [XHCI])
        Subsystem: ASUSTeK Computer Inc. P8P67 Deluxe Motherboard
        Flags: bus master, fast devsel, latency 0, IRQ 19
        Memory at f9ffe000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: [50] Power Management version 3
        Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [90] MSI-X: Enable+ Count=8 Masked-
        Capabilities: [a0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Device Serial Number ff-ff-ff-ff-ff-ff-ff-ff
        Capabilities: [150] Latency Tolerance Reporting
        Kernel driver in use: xhci_hcd

...

_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Aug 03, 2013 3:32 pm    Post subject: Reply with quote

What does `cat /sys/class/block/sdb/queue/scheduler` say? Does changing that affect it at all?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sat Aug 03, 2013 3:49 pm    Post subject: Reply with quote

PanzerKanzler,

Your USB device tree shows how all of your USB devices are connected, like the branches of a tree, back to your PC.
Your PC contains devices called USB root hubs. each root hub is normally a pair of USB sockets.

Oh dear .... Amazon Technical Info says
Code:
 Special Features

    USB Powered


A USB root hub (both sockets) can provide at most 500mA at 5v of power. Thats only 2.5W.
What happens when you overload a USB root hub varies, from absolutely nothing to total shutdown.

I suspect you have a USB power problem
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Sun Aug 04, 2013 1:27 am    Post subject: Reply with quote

Ant P. wrote:
What does `cat /sys/class/block/sdb/queue/scheduler` say? Does changing that affect it at all?

It was using cfq, and changing to noop, anticipatory or deadline did not change things for me (at least not noticable).

NeddySeagoon wrote:
Your USB device tree shows how all of your USB devices are connected, like the branches of a tree, back to your PC.
Your PC contains devices called USB root hubs. each root hub is normally a pair of USB sockets.

This is what I see in KInfoCenter. Does this illustrate my USB device tree?

NeddySeagoon wrote:
I suspect you have a USB power problem

The disk is designed for being USB powered, and I have no other devices connected (save the keyboard and mouse). For this reason, I find it unlikely that the power should be insufficient. Or do you mean it could be some power saving function which causes the USB power to be too low for the disk?
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Sun Aug 04, 2013 10:27 am    Post subject: Reply with quote

PanzerKanzler,

The 500mA limit comes with a tolerance at the PC end and the HDD end. When the tolerances work against you, you are in trouble.
Personally, I would not buy a USB powered HDD because of the known power issues.
Even hacks like a USB Y-cable to use power from two root hubs are not reliable.

I assume the keyboard and mouse are on a different root hub to the HDD?
If not, that may push the root hub over the power limit.

Is there anything in dmesg?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Sun Aug 04, 2013 11:15 am    Post subject: Reply with quote

Hmm.. After some more testing, it seems that the problem is dependent on file size.

Writing 26.2G (1274 files, smallest 3.5M, largest 95M) gives a transfer time of 489,797 seconds (~55 MBps, which is acceptable)
Writing 6.6G (six 1.1G files) gives a transfer time of 91.423 seconds (~74 MBps, which is good).
Writing one 2.5G file gives a transfer time of 168.837 seconds (~15 MBps, which is poor).
Writing one 3.6G file gives a transfer time of 386.342 seconds (~10 MBps, which is really poor).

What can be the cause?
(Of course, by the innate mischief of things, the files which I need to write are 3.5G-3.8G.)
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9645
Location: almost Mile High in the USA

PostPosted: Tue Aug 06, 2013 6:07 pm    Post subject: Reply with quote

I highly doubt file size is the issue, and have to agree with Neddyseagoon, this is most likely a power issue. Can you replicate this on another machine?

Standard USB3 ports can provide a bit more power than USB2, if you have a true usb3 cable and straight connection (no usb2 extensions) to the host powered port, you should be able to get 900mA (4.5W) from USB3. Most laptop HDDs should be satisfied by this though there are a few 5W outliers out there.

I also have this issue with plugs/connectors. I have a Nokia N900 phone that can draw up to 5W through USB2 given the right conditions for charging the battery. But contact quality tends to limit this greatly. Given cheap cables, it won't charge right. I have only 2 USB cables that will charge this phone correctly and get the 5W to charge the phone.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
rndusr
Guru
Guru


Joined: 04 Dec 2005
Posts: 392

PostPosted: Wed Aug 07, 2013 11:55 pm    Post subject: Reply with quote

I have now tried on two other computers (USB2 only, though), and there I do not experience this issue. They both were able to write at about 24 MBps, no matter file size. Unfortunately, I have just one computer with USB3.

I also tried using one of the USB2 ports instead of USB3, but I still have the same issues on this computer.
The transfer times in my last post are still reproducible on this computer. (Writing those same files to another computer over ethernet is very fast, so it is not reading the files that is slow.)

I understand that laptops may be parsimonious with power for the USB ports, but this computer is an ordinary desktop.
(By now, I have written all the large files I needed to write. I had to leave it overnight. Reading them from the disk gives me good rates.)
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum