# USB3 HD latency high?

## grant123

The mpd client cantata is very laggy when scrolling through album art which is stored on my USB3 hard drive.  If I unmount the drive, scrolling is very fast as it uses cached images at that point.  I filed a cantata bug and the author says no one else has complained about this and there must be a problem with my hard drive setup.  Can I test the drive's latency or something?

----------

## eccerr0r

You should be able to use the normal tests on a USB3 HDD, not any different than USB2 except speed.  You can try hdparm -t on it just like any other hard drive, to see how it does for sequential reads.  See if there are any messages showing up in dmesg.

At one point I had an SSD on USB3 and it was not a problem at all.  Getting 170+ MB/sec through USB3.  The SSD is now on a 6Gbps SATA port so it's not likely to see USB3 again.

USB3 however is still under development and who knows what shows up from time to time.

----------

## grant123

Is this OK?

# hdparm -t /dev/sdb

/dev/sdb:

Timing buffered disk reads: 218 MB in  3.00 seconds =  72.62 MB/sec

Is that a good benchmark to diagnose the type of problem I described?

----------

## creaker

it is good read speed if your drive is not a SSD. With my Seagate FreeAgent I have 73.22 Mb/sec.

----------

## grant123

Can I run a test specifically for latency instead of throughput?

----------

## eccerr0r

You can try bonnie++ or iozone to check out iops, etc.

I haven't seen too many cases where hdparm shows up fairly good and iops isn't already as high as it could be for a specific hardware without a kernel fix, but I could be wrong.

----------

## eccerr0r

Wait a minute...

If you do hdparm over and over again on your USB3 drive while scrolling through album art that's *not* stored on that USB3 drive, how bad is it?

Perhaps your USB3 controller is not doing DMA properly? 

Does it work better when you hooked up to a USB2 port?

----------

## grant123

I checked it on a USB2 port and unfortunately it's no better.

I scrolled through the album art that is already cached and it's fast, even if I run the hdparm test on the drive while I'm scrolling.  As soon as I get to the uncached art, it becomes very laggy again.

----------

## grant123

The cantata author added a couple directives that completely fixed this.  For anyone else having this problem, add the following to the [Global] or [General] section of ~/.config/cantata/cantata.conf or ~/.kde/share/config/cantatarc:

maxCoverFindPerIteration=0

maxCoverUpdatePerIteration=1

*Highly* recommended mpd client.

----------

## eccerr0r

This is very weird. USB HDDs shouldn't be that slow to cause UI slowdown...

Bleh, crappy software...

----------

