SATA Performance + Max Disk Size

Hello BPI Team,

i have a question to the R2 Board. What is the max HDD Size supported by the Board ?

Have you any SATA Performance Report ?

Thanks a lot, René

Hi,

don’t known about max hdd size.

Just tested with a 32GB Intel SSD on SATA. It achieves 130MB/sec (writes and reads are at the same speed).

Perfs may be bound by cpu, since there is no heatsink on it (seen on some other boards : cpu speed is heavily lowered when no heatsink).

Sand.

I have a SAMSUNG SSD DISK, the Read/Write performance are below:

(1) Read from disk: 230MB/s (command: dd if=/dev/sda of=/dev/zero bs=1M count=10240)

(2) Write to disk: 192MB/s (command: dd if=/dev/zero of=/dev/sda bs=1M count=1024 oflag=direct)

Great … Thanks a lot :slight_smile:

Last question is … what´s the max Disk Size 4TB / 10TB ? :slight_smile:

SATA II max size is 4TB AFAIK

Hi AaronNGray,

is can not found a size Limitation of SATA II in any Specfile i can found.

The BPI-R2 has two SATA 3.0 Ports / 6 Gbps and not SATA II :slight_smile:

@Rene

The disk size just is up to 4TB, don’t support 10TB

@garywang

is this limited by the “pcie to sata” chip ?

@Rene your right it is SATA III

@garywang have you tested HDD´s bigger than 4TB ?

The vendor’s statement is: the 10TB hard disk is supported when latest firmware is installed. But we don’t validate this, maybe it’s worth to do…

I purchased a BPI-R2 and was testing with two 8TB drives equivalent to Western Digital Red drives (white labeled, model WDC WD80EMAZ-00WJTA0, shucked from external WD Easystore drives). I connected the two drives to the SATA ports of the BPI-R2.

I’m just testing sequential access. I was using dd, but I think I was maxing out the CPU, so this test uses fio because it only uses <30% CPU while running. When I use either drive alone, I easily get 190MB/s as expected, but when I access both drives concurrently I only get speeds of 156MB/s.

Is this a known limitation of the BPI-R2 or the ASM106x SATA chip?

Full test results:

(In the test results “bw” indicates the bandwidth, the speed it read from disk.)

pi@bpi-iot-ros-ai:~$ sudo fio - <<EOF
> [global]
> iodepth=16
> direct=1
> ioengine=libaio
> randrepeat=0
> time_based
> runtime=300
> filesize=2g
> blocksize=1m
>
> [job1]
> rw=read
> filename=/dev/sda
> name=read-sda-concurrent
>
> [job2]
> rw=read
> filename=/dev/sdb
> name=read-sdb-concurrent
> EOF

read-sda-concurrent: (g=0): rw=read, bs=1M-1M/1M-1M/1M-1M, ioengine=libaio, iodepth=16
read-sdb-concurrent: (g=0): rw=read, bs=1M-1M/1M-1M/1M-1M, ioengine=libaio, iodepth=16
fio-2.2.10
Starting 2 processes
Jobs: 2 (f=2): [R(2)] [100.0% done] [306.4MB/0KB/0KB /s] [306/0/0 iops] [eta 00m:00s]
read-sda-concurrent: (groupid=0, jobs=1): err= 0: pid=6182: Wed Dec  6 10:19:42 2017
  read : io=45890MB, bw=156585KB/s, iops=152, runt=300101msec
    slat (usec): min=561, max=15806, avg=879.77, stdev=244.13
    clat (msec): min=16, max=194, avg=103.63, stdev= 5.22
     lat (msec): min=17, max=195, avg=104.51, stdev= 5.21
    clat percentiles (msec):
     |  1.00th=[  102],  5.00th=[  103], 10.00th=[  103], 20.00th=[  103],
     | 30.00th=[  103], 40.00th=[  103], 50.00th=[  103], 60.00th=[  103],
     | 70.00th=[  103], 80.00th=[  104], 90.00th=[  104], 95.00th=[  104],
     | 99.00th=[  115], 99.50th=[  143], 99.90th=[  176], 99.95th=[  182],
     | 99.99th=[  196]
    bw (KB  /s): min=127494, max=174384, per=49.97%, avg=156520.52, stdev=4477.58
    lat (msec) : 20=0.01%, 50=0.05%, 100=0.71%, 250=99.24%
  cpu          : usr=0.39%, sys=13.68%, ctx=49651, majf=0, minf=4120
  IO depths    : 1=0.1%, 2=0.1%, 4=0.2%, 8=0.4%, 16=99.2%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=99.9%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued    : total=r=45890/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=16
read-sdb-concurrent: (groupid=0, jobs=1): err= 0: pid=6183: Wed Dec  6 10:19:42 2017
  read : io=45914MB, bw=156669KB/s, iops=152, runt=300098msec
    slat (usec): min=572, max=10796, avg=894.37, stdev=223.55
    clat (msec): min=14, max=198, avg=103.55, stdev= 5.92
     lat (msec): min=15, max=200, avg=104.45, stdev= 5.91
    clat percentiles (msec):
     |  1.00th=[   99],  5.00th=[  103], 10.00th=[  103], 20.00th=[  103],
     | 30.00th=[  103], 40.00th=[  103], 50.00th=[  103], 60.00th=[  103],
     | 70.00th=[  103], 80.00th=[  104], 90.00th=[  104], 95.00th=[  104],
     | 99.00th=[  112], 99.50th=[  145], 99.90th=[  188], 99.95th=[  196],
     | 99.99th=[  198]
    bw (KB  /s): min=124678, max=176761, per=50.04%, avg=156753.73, stdev=3872.08
    lat (msec) : 20=0.01%, 50=0.06%, 100=1.04%, 250=98.90%
  cpu          : usr=0.42%, sys=13.83%, ctx=50490, majf=0, minf=4120
  IO depths    : 1=0.1%, 2=0.1%, 4=0.2%, 8=0.4%, 16=99.2%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=99.9%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued    : total=r=45914/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=16

Run status group 0 (all jobs):
   READ: io=91804MB, aggrb=313252KB/s, minb=156585KB/s, maxb=156668KB/s, mint=300098msec, maxt=300101msec

Disk stats (read/write):
  sda: ios=45888/0, merge=0/0, ticks=4750290/0, in_queue=4750400, util=100.00%
  sdb: ios=45913/0, merge=0/0, ticks=4747660/0, in_queue=4747610, util=100.00%

ahci420g.rom (37.3 KB) 106flash (41.0 KB)

Can you please copy both files above to ubuntu, and run command ./106flash -u ahci420g.rom_ to update the firmware, and then test again?

Performance appears to be the same (157 MB/s per disk when accessed concurrently) after updating the firmware.

Is this firmware update permanent? Does it need to be applied each boot?

This speed still pretty good for spinning disks though, they are often slower than this during random access anyway. It won’t affect my usage of the BPI-R2 significantly.

The firmware is programmed to NVRAM, so it’s permanent, so no need to update it each boot.

Can you please share me the log of below commands: dmesg lspci -s <pcie bus that is ASM1061’s connected to> smartctl -a /dev/sdX

Actually it seems to just be some kind of SATA bandwidth limit just over 300 MB/s for some reason. I tested with a pair of random SSDs I have. Even if I just access one drive the bandwidth seems to be capped just over 300 MB/s (both are faster than 300 MB/s for sequential reads).

Speeds of 307 MB/s sound like the 3Gb/s cap of SATA II but both dmesg and smartctl indicate that the SATA link is up at 6.0 Gbps, which sounds like SATA III should be working.

It looks like the update applied to the ASM106x chip fine, it reported no errors. Before the update I think lspci used to show “ASM1061” but it now shows “ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 01)”.

Also, I don’t think it’s related but my board did have minor damage when it was shipped to me. The damage does appear to be between the processor and the ASM1061 chip. I mentioned this in a message on AliExpress, but all that was asked was whether the board worked or not.

board damage

Have you successfully tested the SATA link on any BPI-R2 board above 300 MB/s?

Here are the logs you requested: https://gist.github.com/bburky/875ed9499dde42ba270183cf362b96c8 (The forum has a character limit of 50000 characters, I couldn’t post it here.)

I have the same result using kernel 4.9. How do go over 300 MB/s?

# lspci -v
00:01.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)
01:00.0 IDE interface: ASMedia Technology Inc. ASM1061 SATA IDE Controller (rev 02) (prog-if 85 [Master SecO PriO])
	Subsystem: ASMedia Technology Inc. ASM1061 SATA IDE Controller
	Flags: bus master, fast devsel, latency 0, IRQ 219
	I/O ports at 1010 [size=8]
	I/O ports at 1020 [size=4]
	I/O ports at 1018 [size=8]
	I/O ports at 1024 [size=4]
	I/O ports at 1000 [size=16]
	Memory at 60000000 (32-bit, non-prefetchable) [size=512]
	[virtual] Expansion ROM at 60100000 [disabled] [size=64K]
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit-
	Capabilities: [78] Power Management version 3
	Capabilities: [80] Express Legacy Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Kernel driver in use: ahci

Test command and result:

# dd if=/dev/sdb of=/dev/zero bs=1M count=10240
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB, 10 GiB) copied, 41.2857 s, 260 MB/s

@xbgmsharp That should work fine, assuming the disk is fast enough. Are you sure your disk does >300MB/s? What model is it and can you show the output of smartctl -a /dev/sdb please?

A bit more details. Don’t get me wrong, performance are fine, read 260 MB/s and write 180 MB/s. However both bpi-r2 and the disk are SATA 6.0 Gbps, i would expect performance closer to 500 MB/s than 300 MB/s, what should be the best expected performance

  • SATA revision 1.0 => 1.5 Gbit/s, 150 MB/s
  • SATA revision 2.0 => 3 Gbit/s, 300 MB/s
  • SATA revision 3.0 => 6 Gbit/s, 600 MB/s

/sys, https://ark.intel.com/products/94209/Intel-SSD-540s-Series-480GB-2_5in-SATA-6Gbs-16nm-TLC

# cat /sys/class/block/sda/device/{model,vendor}
INTEL SSDSC2KW48
ATA     
# cat /sys/class/block/sdb/device/{model,vendor}
INTEL SSDSC2KW48
ATA     

link:

# for i in `grep -l Gbps /sys/class/ata_link/*/sata_spd`; do  echo Link "${i%/*}" Speed `cat $i`;  done
Link /sys/class/ata_link/link1 Speed 6.0 Gbps
Link /sys/class/ata_link/link2 Speed 6.0 Gbps

dmesg:

[    2.161070] ata1: SATA max UDMA/133 abar m512@0x60000000 port 0x60000100 irq 219
[    2.175988] ata2: SATA max UDMA/133 abar m512@0x60000000 port 0x60000180 irq 219
[    2.674730] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.681656] ata1.00: ATA-10: INTEL SSDSC2KW480H6,  LSF036C, max UDMA/133
[    2.688345] ata1.00: 937703088 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    2.696012] ata1.00: configured for UDMA/133
[    3.284746] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    3.291643] ata2.00: ATA-10: INTEL SSDSC2KW480H6,  LSF036C, max UDMA/133
[    3.298334] ata2.00: 937703088 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    3.305981] ata2.00: configured for UDMA/133

read test sda & sdb:

# dd if=/dev/sdb of=/dev/zero bs=1M count=10240
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB, 10 GiB) copied, 41.2126 s, 261 MB/s
# dd if=/dev/sda of=/dev/zero bs=1M count=10240
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB, 10 GiB) copied, 40.9588 s, 262 MB/s

Test write sda & sdb

# dd if=/dev/zero of=/mnt/sda/zero bs=1M count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.74139 s, 187 MB/s
# dd if=/dev/zero of=/mnt/sdb/zero bs=1M count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.903 s, 182 MB/s

I wanted to put this data on the encryption thread, but it seems to be I/O bounded so the numbers are more suited here (and similar to xbgmsharp numbers, just that writing).

Using AF_ALG (kernel cryptography)

I made a program to fill a hard disk with random data using the kernel, hardware supported random generator.

The disk is a Seagate ST2000LM007 Size : 2000398934016 bytes ( 1.82 TB ) The program calculated blocks of 4096 bytes of random data (AF_ALG return 128 bytes of random data in each call) For a total of 488378646 direct writings to the disk (no buffers used by the nature of the process)

The total processing time was 7300 seconds or 261.33 MB/s for filling a SATA hard disk with random data.

This is the same 261 obtained by xbgmsharp for reading data, and it shows that the hardware random generator it is extremely fast. I will make a better test on this later.

As an important detail, this happened with the 1.2 version R2 machine. It is a little different than the 1.1 version. With 4.4.70 kernel.

1 Like