USB 하드 디스크 I/O 속도가 느립니다.

USB 하드 디스크 I/O 속도가 느립니다.

나는 몇 가지를 가지고 있습니다미디어소닉 프로박스 HF2-SU3S24개의 드라이브가 있습니다. 모두 동일한 증상이 있으며 I/O가 매우 느립니다(최대 약 10MB/s 쓰기). 각 장치는 mdadm 및 4개의 드라이브를 사용하는 소프트웨어 RAID 5로 구성됩니다.

USB 2.1 포트에 연결되는데, USB 3.0보다 느릴 것으로 예상했지만 10MB/s는 의심스럽고 터무니없을 정도로 느린 것 같습니다.

각 드라이브에 대해 smartctl -a 출력을 게시할 수 있지만 어떤 드라이브도 실패하지 않으며 드라이브 관련 syslog에 오류가 기록되지 않습니다.

첫 번째 장치의 드라이브는 다음과 같습니다.

Device Model:     ST2000DL003-9VT166
Device Model:     ST2000DM001-1ER164
Device Model:     ST2000DM001-1CH164
Device Model:     ST2000DM001-1CH164

두 번째 장치 드라이브:

Device Model:     ST2000DL003-9VT166
Device Model:     ST2000DL003-9VT166
Device Model:     WDC WD20EADS-00R6B0
Device Model:     ST2000DL003-9VT166

커널 버전:

3.16.0-6-amd64 #1 SMP Debian 3.16.57-2

마운트 출력:

/dev/md2 on /mnt/nas type ext4 (rw,relatime,stripe=256,data=ordered)
/dev/md3 on /mnt/nas2 type ext4 (rw,relatime,stripe=384,data=ordered)

/proc/mdstat의 출력

md3 : active raid5 sdg[5] sdj[4] sdi[6] sdh[1]
      5860150272 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 0/15 pages [0KB], 65536KB chunk

md2 : active raid5 sdc1[0] sdf1[4] sdd1[6] sde1[5]
      5860141056 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]

dd를 사용하여 다음을 테스트하세요.

root@talon:/mnt/nas2# dd if=/dev/zero of=/mnt/nas2/testfile bs=1G count=1 oflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 71.1888 s, 15.1 MB/s

root@talon:/mnt/nas# dd if=/dev/zero of=/mnt/nas/testfile bs=1G count=1 oflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 80.8867 s, 13.3 MB/s

mdadm --detail의 출력

/dev/md2:
        Version : 1.2
  Creation Time : Wed May  1 22:26:29 2013
     Raid Level : raid5
     Array Size : 5860141056 (5588.67 GiB 6000.78 GB)
  Used Dev Size : 1953380352 (1862.89 GiB 2000.26 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Wed Dec  5 21:29:12 2018
          State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : dev-vm01:0
           UUID : dc4e42f6:3c3eb2f7:d6137927:51e328ef
         Events : 21688

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       5       8       65        1      active sync   /dev/sde1
       6       8       49        2      active sync   /dev/sdd1
       4       8       81        3      active sync   /dev/sdf1

=-===-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

/dev/md3:
        Version : 1.2
  Creation Time : Sat Mar 10 11:08:14 2018
     Raid Level : raid5
     Array Size : 5860150272 (5588.67 GiB 6000.79 GB)
  Used Dev Size : 1953383424 (1862.89 GiB 2000.26 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Wed Dec  5 21:23:31 2018
          State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : dragon:0
           UUID : 70d8f410:462c6714:50231e20:b08aca81
         Events : 151906

    Number   Major   Minor   RaidDevice State
       5       8       96        0      active sync   /dev/sdg
       1       8      112        1      active sync   /dev/sdh
       6       8      128        2      active sync   /dev/sdi
       4       8      144        3      active sync   /dev/sdj

더 자세한 정보

root@talon:/mnt/nas# lsusb
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 001 Device 002: ID 2109:3431
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@talon:/mnt/nas# lsusb -v -s 3:2

Bus 003 Device 002: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x152d JMicron Technology Corp. / JMicron USA Technology Corp.
  idProduct          0x0567
  bcdDevice            2.05
  iManufacturer          10 JMicron
  iProduct               11 USB to ATA/ATAPI Bridge
  iSerial                 5 152D00539000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 USB Mass Storage
    bmAttributes         0xc0
      Self Powered
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              6 MSC Bulk-Only Transport
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x0001
  Self Powered


=-=-=-=-=-=-=-=-=-==-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

root@talon:/mnt/nas# lsusb -v -s 1:3

Bus 001 Device 003: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x152d JMicron Technology Corp. / JMicron USA Technology Corp.
  idProduct          0x0567
  bcdDevice            2.05
  iManufacturer          10 JMicron
  iProduct               11 USB to ATA/ATAPI Bridge
  iSerial                 5 152D00539000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 USB Mass Storage
    bmAttributes         0xc0
      Self Powered
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              6 MSC Bulk-Only Transport
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
       bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x0001
  Self Powered

"USB 2.1 포트에 연결된 것 같습니다." 이것을 어떻게 확인하셨나요?

lsusb의 출력을 봅니다.

bcdUSB               2.10

어떤 마더보드 또는 컴퓨터 모델을 사용하고 있으며 어떤 USB 포트를 사용하고 있습니까?

마더보드: GA-78LMT-USB3 버전과 정확한 포트를 확인해야 했습니다.

이 PC에서 다른 포트를 사용해 보셨나요? 그렇다면 같은 결과가 나오나요?

예 - 서로 다른 USB 포트를 통해 동일한 데스크탑에 2개의 장치가 연결되었습니다. 심지어 Raspberry Pi에서도 이 속도를 얻을 수 있습니다.

USB 2.0은 USB 3.0보다 훨씬 느립니다. USB 2.0을 통해 직접 연결된 하드 드라이브는 20MB/초를 거의 초과하지 않는 반면, USB 3.0에서는 작은 2.5인치 디스크도 100MB/초를 달성할 수 있습니다.

디스크 크기는 중요하지 않습니다. 나는 이것을 믿지 않습니다. 느리지만 10MB/s보다 빠를 것이라는 많은 리소스가 있습니다.

장치 중 하나를 알려진 USB 3.0 포트에 연결했습니다.

Bus 002 Device 002: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         9
  idVendor           0x152d JMicron Technology Corp. / JMicron USA Technology Corp.
  idProduct          0x0567
  bcdDevice            2.05
  iManufacturer          10 JMicron
  iProduct               11 USB to ATA/ATAPI Bridge
  iSerial                 5 152D00539000

이제 전송 속도가 3배 빨라졌지만 여전히 예상 속도만큼 빠르지는 않습니다.

root@talon:/mnt/nas2# dd if=/dev/zero of=/mnt/nas2/testfile4 bs=1G count=1 oflag=direct
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 32.2737 s, 33.3 MB/s

fdisk의 출력:

Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0xe3b023b3

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdc1          63 3907024064 3907024002  1.8T 83 Linux


Disk /dev/sdd: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x580e98e6

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdd1        2048 3907029167 3907027120  1.8T 83 Linux


Disk /dev/sde: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x000d19a7

Device     Boot Start        End    Sectors  Size Id Type
/dev/sde1        2048 3907028991 3907026944  1.8T 83 Linux


Disk /dev/sdf: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0xc16a55ab

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdf1        2048 3907029167 3907027120  1.8T 83 Linux

Disk /dev/sdg: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0xc91d9f27

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdg1        2048 3907028991 3907026944  1.8T fd Linux raid autodetect


Disk /dev/sdj: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x65cd7624

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdj1        2048 3907028991 3907026944  1.8T fd Linux raid autodetect


Disk /dev/sdi: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x03221dd4

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdi1        2048 3907028991 3907026944  1.8T fd Linux raid autodetect


Disk /dev/sdh: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0xc91329ab

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdh1        2048 3907028991 3907026944  1.8T fd Linux raid autodetect

편집: 몇 가지 문제 해결을 수행한 결과 USB 컨트롤러에 문제가 있는 것으로 나타났습니다. 이것이 Linux와 마더보드의 USB 컨트롤러 간의 호환성 문제인지는 확실하지 않습니다. 그러나 최신 커널을 사용해 보았지만 Linux는 USB 3.0 포트에서 장치를 초기화하는 것조차 거부했습니다. 그러나 USB 3.0 연결이 가능한 노트북에서 Probox를 사용해 본 결과 매우 잘 작동했습니다.

답변1

USB2 속도(60MB/s)를 동시에 RAID 쓰기의 드라이브 수(4)로 나눈 값은 15MB/s에 약간의 오버헤드를 더한 것이므로 10이 합리적이라고 생각됩니다.

RAID 제거를 테스트하여 버스를 사용하고 있지 않은지 확인한 후 다음을 실행하십시오.

hdparm -Tt /dev/sdh

답변2

내장된 USB 컨트롤러는 거기에 인쇄된 실리콘보다 가치가 낮은 것으로 나타났습니다. PCI-e USB 3.1 컨트롤러를 설치했는데 이제 속도가 10MB/s가 아닌 61MB/s입니다. 데이터 전송 속도 측면에서 아직 "빠르지"는 않지만 60MB/s는 큰 차이입니다.

관련 정보