helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
807 stars 58 forks source link

Improve performance of ASMedia AS2115 USB3 SATA adapter #477

Open probonopd opened 1 year ago

probonopd commented 1 year ago

I am under the impression that SSDs connected to the compiter via a ASMedia AS2115 USB3 SATA adapter are unacceptably slow, although I need a scientific method to test this.

usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device ASMedia AS2115 (0x174c:0x1153)
ugen1.16: <ASMedia AS2115> at usbus1
umass0 on uhub7
umass0: <ASMedia AS2115, class 0/0, rev 2.10/0.01, addr 15> on usbus1
umass0:  SCSI over Bulk-Only; quirks = 0x0100
umass0:0:0: Attached to scbus0
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <ASMT 2115 0> Fixed Direct Access SPC-4 SCSI device
da0: Serial Number 00000000000000000000
da0: 40.000MB/s transfers
da0: 122104MB (250069680 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>

Is there anything we can do to remove bottlenecks? I don't expect native SATA performance, but I expect better than what I am seeing.

probonopd commented 1 year ago

When attached to a USB 2 port:

diskinfo -ctv /dev/da0  
/dev/da0
        512             # sectorsize
        128035676160    # mediasize in bytes (119G)
        250069680       # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        15566           # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        ASMT 2115       # Disk descr.
        00000000000000000000    # Disk ident.
        umass-sim0      # Attachment
        No              # TRIM/UNMAP support
        Unknown         # Rotation rate in RPM
        Not_Zoned       # Zone Mode

I/O command overhead:
        time to read 10MB block      0.303649 sec       =    0.015 msec/sector
        time to read 20480 sectors   8.000747 sec       =    0.391 msec/sector
        calculated command overhead                     =    0.376 msec/sector

Seek times:
        Full stroke:      250 iter in   0.118346 sec =    0.473 msec
        Half stroke:      250 iter in   0.120239 sec =    0.481 msec
        Quarter stroke:   500 iter in   0.246065 sec =    0.492 msec
        Short forward:    400 iter in   0.191458 sec =    0.479 msec
        Short backward:   400 iter in   0.190577 sec =    0.476 msec
        Seq outer:       2048 iter in   0.768755 sec =    0.375 msec
        Seq inner:       2048 iter in   0.769058 sec =    0.376 msec

Transfer rates:
        outside:       102400 kbytes in   3.030133 sec =    33794 kbytes/sec
        middle:        102400 kbytes in   3.031033 sec =    33784 kbytes/sec
        inside:        102400 kbytes in   3.026505 sec =    33834 kbytes/sec

When attached to a USB 3 port:

sudo diskinfo -ctv /dev/da0 
Password:
/dev/da0
        512             # sectorsize
        128035676160    # mediasize in bytes (119G)
        250069680       # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        15566           # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        ASMT 2115       # Disk descr.
        00000000000000000000    # Disk ident.
        umass-sim0      # Attachment
        No              # TRIM/UNMAP support
        Unknown         # Rotation rate in RPM
        Not_Zoned       # Zone Mode

I/O command overhead:
        time to read 10MB block      0.044089 sec       =    0.002 msec/sector
        time to read 20480 sectors   7.680171 sec       =    0.375 msec/sector
        calculated command overhead                     =    0.373 msec/sector

Seek times:
        Full stroke:      250 iter in   0.099130 sec =    0.397 msec
        Half stroke:      250 iter in   0.100710 sec =    0.403 msec
        Quarter stroke:   500 iter in   0.206580 sec =    0.413 msec
        Short forward:    400 iter in   0.160165 sec =    0.400 msec
        Short backward:   400 iter in   0.154299 sec =    0.386 msec
        Seq outer:       2048 iter in   0.768063 sec =    0.375 msec
        Seq inner:       2048 iter in   0.769027 sec =    0.376 msec

Transfer rates:
        outside:       102400 kbytes in   0.415900 sec =   246213 kbytes/sec
        middle:        102400 kbytes in   0.414139 sec =   247260 kbytes/sec
        inside:        102400 kbytes in   0.417333 sec =   245368 kbytes/sec
probonopd commented 1 year ago

Over UBS 3, copying to an ExFAT formatted partition:

pv 'cm-x86_64-14.1-r5-k419.iso' > /media/Ventoy/cm-x86_64-14.1-r5-k419.iso
 699MiB 0:00:08 [82.1MiB/s] [===============================================>] 100% 

So the copy operations are not terribly bad. Possibly it's certain types of accesses that slow it down to a crawl?

SSD in use: Intenso 2.5" SSD TOP 128 GB