Bug 247964 - Low read throughput on Sandisk Extreme external SSD
Summary: Low read throughput on Sandisk Extreme external SSD
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-usb (Nobody)
Keywords: needs-qa, performance
Depends on:
Reported: 2020-07-14 08:35 UTC by Tom Jones
Modified: 2021-09-20 08:14 UTC (History)
3 users (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Note You need to log in before you can comment on or make changes to this bug.
Description Tom Jones freebsd_committer 2020-07-14 08:35:53 UTC
With a 250GB Sandisk Extreme external SSD read performance with FreeBSD is lower than Linux and macOS. I have tested this on FreeBSD on a Thinkpad x270 and 10th Generation Intel NUC. On Linux on the Intel NUC and from MacOS on a 2018 Macbook pro.

I evaluated read and write performance by using dd (with only path adaptations for Linux and macOS) on the device:

dd if=/dev/zero of=/dev/da0 bs=1m count=50000
dd if=/dev/da0 of=/dev/null bs=1m count=50000

On all platforms write speed is approximately 200MB/s
On Linux and macOS read speed is approximately 500MB/s, while on FreeBSD it is approx 200MB/s
Comment 1 Hans Petter Selasky freebsd_committer 2020-07-14 08:49:32 UTC
You should be aware that Linux buffers reads and writes to/from the raw block device, /dev/xxx . FreeBSD does not.
Comment 2 Gary Jennejohn 2021-09-20 08:14:59 UTC
(In reply to Tom Jones from comment #0)
You don't state which USB version you're using, but based on the transfer speeds it must be USB3.
Not all USB3 ports/external enclosures are created equal.  Is it USB3.0, USB3.1 or USB3.2?  You don't state which USB3 versions your various computers support.
For example, my FreeBSD box supports USB3.1 Gen 1 and, using the dd values you provide, I get a transfer rate of 378MB/s from a 1TB Samsung SSD 870 EVO (when I plug it in the USB stack reports 400MB/s transfers).  When I plug this SSD into a Linux server, which only has USB3.0 support, I get only a 205MB/s transfer rate, while using the equivalent Linux dd command.
So, don't blame FreeBSD alone.  The USB3 hardware plays a big role in transfer rates.
Note that the Linux server has a AMD 6-core 3.2GHz CPU and the FreeBSD box has a Ryzen 7 3700X.  But the CPU shouldn't a bottleneck for USB transfers.