ras07
Posts: 34
Joined: Tue May 22, 2018 4:04 am

Weird USB slowdown on 3B+

Fri Jun 21, 2019 10:05 pm

I have 3.5" EXT4-formatted HD in an externally-powered USB enclosure attached to a Pi 3B+ running the latest Raspian Stretch Lite. If I flash a new SD card, I'll see a sustained large-file transfer rate of over 35MB/sec (280 Mbit/sec) to/from the hard drive.But after some hours or days, the best-case transfer rate suddenly drops by about 20%, and the most I can ever achieve is less than 30MB/sec. This is with nothing changing on the hard drive itself, and it doesn't seem to be related to temperature, reboots, or any other software packages being installed. Nothing I try restores the transfer rate, except for reflashing the SD card - if I do that, I immediately see the higher transfer rate.

I'm using a 3A power supply and I don't believe I have any power or temp issues. vcgencmd get_throttled always shows zero. Rebooting will not restore the higher transfer rate. In all cases, iperf3 shows a very consistent 280 Mbit/sec transfer rate over gigabit ethernet.

It's almost like something trips, and it permanently throttles the disk throughput from that point forward. Can anybody explain what could be going on?

ejolson
Posts: 3055
Joined: Tue Mar 18, 2014 11:47 am

Re: Weird USB slowdown on 3B+

Sat Jun 22, 2019 11:17 am

ras07 wrote:
Fri Jun 21, 2019 10:05 pm
I have 3.5" EXT4-formatted HD in an externally-powered USB enclosure attached to a Pi 3B+ running the latest Raspian Stretch Lite. If I flash a new SD card, I'll see a sustained large-file transfer rate of over 35MB/sec (280 Mbit/sec) to/from the hard drive.But after some hours or days, the best-case transfer rate suddenly drops by about 20%, and the most I can ever achieve is less than 30MB/sec. This is with nothing changing on the hard drive itself, and it doesn't seem to be related to temperature, reboots, or any other software packages being installed. Nothing I try restores the transfer rate, except for reflashing the SD card - if I do that, I immediately see the higher transfer rate.

I'm using a 3A power supply and I don't believe I have any power or temp issues. vcgencmd get_throttled always shows zero. Rebooting will not restore the higher transfer rate. In all cases, iperf3 shows a very consistent 280 Mbit/sec transfer rate over gigabit ethernet.

It's almost like something trips, and it permanently throttles the disk throughput from that point forward. Can anybody explain what could be going on?
I agree that's weird. Considering how repeatable it is, this slowdown provides a unique opportunity to trouble shoot.

Have you scanned the log files to look for anything that might indicate a change in the mode of operation? Does hdparm or smartctl indicate changed settings before and after? You may want to disable the rotation and deleting of old log files until this problem is sorted.

Another point of view is that the Pi wouldn't automatically be slowing the hard disk down if the slower speeds weren't necessary to prevent data corruption. If this is the case, then instead of a bug, one can appreciate an unexpected resiliency in Linux that ensures everything remains reliable.

LTolledo
Posts: 1538
Joined: Sat Mar 17, 2018 7:29 am

Re: Weird USB slowdown on 3B+

Sat Jun 22, 2019 9:33 pm

I've encountered this, but on another SBC.

the way I troubleshoot it was
1. check the output of dmesg
this was the output that I got then:

Code: Select all

[    2.637111] usb 3-1: device descriptor read/64, error -71
[    2.749569] random: fast init done
[    3.089093] usb 3-1: device descriptor read/64, error -71
[    3.533100] usb 3-1: new high-speed USB device number 3 using ehci-platform
[    3.877094] usb 3-1: device descriptor read/64, error -71
[    4.329091] usb 3-1: device descriptor read/64, error -71
[    4.437114] usb usb3-port1: attempt power cycle
[    5.089093] usb 3-1: new high-speed USB device number 4 using ehci-platform
[    5.505091] usb 3-1: device not accepting address 4, error -71
[    5.841094] usb 3-1: new high-speed USB device number 5 using ehci-platform
[    6.257089] usb 3-1: device not accepting address 5, error -71
[    6.257117] usb usb3-port1: unable to enumerate USB device
[    6.649145] usb 6-1: new full-speed USB device number 2 using ohci-platform
[    6.872159] usb 6-1: not running at top speed; connect to a high speed hub
[    6.884154] usb 6-1: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 2.04
[    6.884168] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    6.884179] usb 6-1: Product: External USB 3.0
[    6.884190] usb 6-1: Manufacturer: JMicron
[    6.884201] usb 6-1: SerialNumber: 201703310007F
[    6.886623] usb-storage 6-1:1.0: USB Mass Storage device detected
[    6.887750] usb-storage 6-1:1.0: Quirks match for vid 152d pid 0578: 1000000
[    6.887924] scsi host0: usb-storage 6-1:1.0
if the line device descriptor read/64, error -71 appeared in the output then there is a problem.

2. check USB drive throughput using hdparm
below is the output when the USB was slow (I was running as root)

Code: Select all

:~# hdparm -t --direct /dev/sda1

/dev/sda1:
 Timing O_DIRECT disk reads:   4 MB in  4.05 seconds = 1011.82 kB/sec


ideally you should get something a bit higher than this:

Code: Select all

~# hdparm -t --direct /dev/sda1

/dev/sda1:
 Timing O_DIRECT disk reads:  88 MB in  3.06 seconds =  28.79 MB/sec



lets see what you got.... can you post it here?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “General discussion”