Hard disk speed

11 7257
I'm in the throws of upgrading my old sheevaplugs to use the new bananapi badboys.

I have been noticing a few issues though, I've been wondering if it's me or does my setup need tweaking.

When I ssh into one of my banana servers, there is a significant pause like 2 seconds, compared to other servers where its Bang straight in.  Obviously that's not an issue in itself, but I wondered if there was a bottleneck somewhere?

So I've done some comparisons, and for some reason, the disk read/write speeds seem to fall short of what I would expect.

So I have my BananaPi and a 32gb SSD sataII plugged into the sata port, infact I've made it the boot drive.
so I'll do two tests: hdparm and dd
  1. $ sudo hdparm -tT /dev/sda

  2. /dev/sda:
  3. Timing cached reads:   746 MB in  2.00 seconds = 372.64 MB/sec
  4. Timing buffered disk reads: 354 MB in  3.01 seconds = 117.48 MB/sec
Copy the Code
About what you'd expect from a sataII I guess?
  1. $ sudo dd if=/dev/zero of=./largefile bs=1M count=1024
  2. 1024+0 records in
  3. 1024+0 records out
  4. 1073741824 bytes (1.1 GB) copied, 24.3236 s, 44.1 MB/s
Copy the Code
That does seem slow to me.  
I'm going to run the same thing on a non ssd connected to the sheevaplug sataI port
  1. sudo hdparm -tT /dev/sda

  2. /dev/sda:
  3. Timing cached reads:   628 MB in  2.00 seconds = 313.50 MB/sec
  4. Timing buffered disk reads: 316 MB in  3.00 seconds = 105.25 MB/sec
Copy the Code
Not too bad compared to the ssd, but when you do the dd
  1. dd if=/dev/zero of=./largefile bs=1M count=1024
  2. 1024+0 records in
  3. 1024+0 records out
  4. 1073741824 bytes (1.1 GB) copied, 13.4737 s, 79.7 MB/s
Copy the Code
There loads of space on both drives, so I wouldn't of thought fragmentation is an issue
I know there could be lots of reasons, but if anything, there's more going on with the sheevaplugs than the bananapi which is a virgin 14.09.

Anyone have any useful tips to try?

Much appreciative

oh btw, the dmesg on the pi does seem to suggest it's only running at sata1 speed
  1. [  110.869453] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
  2. [  115.339245] ata1: limiting SATA link speed to 1.5 Gbps
Copy the Code
Which when you plug it into a different computer (my desktop for instance) it runs at full speed.
Actually after taking the drive offline and plugging into a Cubieboard A10 debian, I get the following:
  1. $ sudo dd if=/dev/zero of=./largefile bs=1M count=1024
  2. 1024+0 records in
  3. 1024+0 records out
  4. 1073741824 bytes (1.1 GB) copied, 18.9139 s, 56.8 MB/s
Copy the Code
Which is slightly faster, but nothing like I would expect.  Maybe its an A10/A20 thing?

I'm going to do more tests

As I suspected, I plugged it into my main computer and it seems to be running at full speed:
  1. $ sudo dd if=/dev/zero of=./largefile bs=1M count=1024
  2. 1024+0 records in
  3. 1024+0 records out
  4. 1073741824 bytes (1.1 GB) copied, 13.3659 s, 80.3 MB/s
Copy the Code
I'm wondering if anyone knows of any disk bottlenecks on these devices?

Appreciate any help, and sorry it's been a long and convoluted post

After doing some research, it would seem that it's a hardware issue with the BPi and other A10/20 boards (hence the cubieboard with similar speed issues)

So, reprieve for one of my sheevaplugs! 4 years going strong, and still can't be beaten on disk speed

Apologies for spamming!

I had almost the same results with my SSD :

See at the bottom of this page for some sysbench :

Long story short my sequential write speed is : 41.46Mb/sec

Post Last Edited by tkaiser at 2014-9-26 01:42

Reply 1# markodeablo

You should take the reduction of the link speed seriously since it might indicate a cable/connector problem (get smartmontools, check the CRC errors of the SSD. If these aren't just a few but many then something's is wrong which will also lead to bad performance since retransmissions occur. And keep in mind that SATA connections are made for maximum 50 matings by specification).

Apart from that there are issues with SATA performance. I managed to get close to 50 MB/sec writing and 120 MB/sec reading on the BananaPi which is better than other A20 boards me and others tried before: ... amp;page=1#pid26962

Ok cool, my sataII disk is only operating on sataI from the dmesg, could that theoretically be some of the cause?

I wonder if it's a driver/kernel/setting?

I'm not complaining though, for £40 it's a great little machine and the closest I can see to it is the cubietruck at more than double the price!

Post Last Edited by tkaiser at 2014-9-26 06:40

Post Last Edited by tkaiser at 2014-9-26 06:39

Reply 7# markodeablo

Both Banana and SSD are SATA II capable. If the linux driver decides to use only SATA I then maybe because too many errors occured while negotiating interface speed (due to cable/connector issues -- a very common source of data corruption and poor performance).

Fortunately SATA uses error correction/detection mechanisms between host and disk and you can have a look whether these sort of errors occur or not. Simple do an "apt-get install smartmontools" and check with "smartctl -a /dev/sda" for SMART attribute 0xC7/199 [1]. If the value is above 0 then something has been wrong in the past (this is a per disk 'lifetime counter'). If it's very high you should try to write some data to the disk and check again. Any increase in CRC error count indicates that you have a cable/connection problem (or more generally speaking: a data corruption problem between SATA controller on the host and SATA controller on the disk)

BTW: Your use of dd to measure disk speeds is misleading since you used file sizes way too small (therefore testing partly Linux fs cache mechanisms instead of the disk itself). Either use file sizes that are multitudes of the RAM size or better use dedicated benchmark utilities (eg. iozone/bonnie++)

[1] ... M.A.R.T._attributes

thanks for your advice I'll install and test it out.

I understand that dd it is misleading and there's a whole raft of real-life tests that should be performed, but what I was comparing against was a 5 year old arm6 marvell plug computer with a sataI interface and a non-ssd drive (a very basic one at that) and the same OS just to give me something to gauge against, and there’s a big difference in throughput both writing and reading.
I've changed the cables and drive and still do not get above 40ms~

Ok, so I've installed the tools, and this is the result.
I'm guessing that as the result has got the passed status that it's ok?
  1. $ sudo smartctl -a /dev/sda
  2. [sudo] password for markodeablo:
  3. smartctl 5.41 2011-06-09 r3365 [armv7l-linux-3.4.90+] (local build)
  4. Copyright (C) 2002-11 by Bruce Allen,

  6. Model Family:     Indilinx Barefoot based SSDs
  7. Device Model:     OCZ-ONYX
  8. Serial Number:    3F29ZAMHPT0435MQOH80
  9. Firmware Version: 1.7
  10. User Capacity:    32,017,047,552 bytes [32.0 GB]
  11. Sector Size:      512 bytes logical/physical
  12. Device is:        In smartctl database [for details use: -P show]
  13. ATA Version is:   8
  14. ATA Standard is:  Exact ATA specification draft version not indicated
  15. Local Time is:    Fri Jan  1 04:56:49 2010 GMT
  16. SMART support is: Available - device has SMART capability.
  17. SMART support is: Enabled

  19. SMART overall-health self-assessment test result: PASSED

  20. General SMART Values:
  21. Offline data collection status:  (0x00)        Offline data collection activity
  22.                                         was never started.
  23.                                         Auto Offline Data Collection: Disabled.
  24. Self-test execution status:      (   0)        The previous self-test routine completed
  25.                                         without error or no self-test has ever
  26.                                         been run.
  27. Total time to complete Offline
  28. data collection:                 (    0) seconds.
  29. Offline data collection
  30. capabilities:                          (0x1d) SMART execute Offline immediate.
  31.                                         No Auto Offline data collection support.
  32.                                         Abort Offline collection upon new
  33.                                         command.
  34.                                         Offline surface scan supported.
  35.                                         Self-test supported.
  36.                                         No Conveyance Self-test supported.
  37.                                         No Selective Self-test supported.
  38. SMART capabilities:            (0x0003)        Saves SMART data before entering
  39.                                         power-saving mode.
  40.                                         Supports SMART auto save timer.
  41. Error logging capability:        (0x00)        Error logging NOT supported.
  42.                                         General Purpose Logging supported.
  43. Short self-test routine
  44. recommended polling time:          (   0) minutes.
  45. Extended self-test routine
  46. recommended polling time:          (   0) minutes.

  47. SMART Attributes Data Structure revision number: 16
  48. Vendor Specific SMART Attributes with Thresholds:
  50.   1 Raw_Read_Error_Rate     0x0000   ---   ---   ---    Old_age   Offline      -       5
  51.   9 Power_On_Hours          0x0000   ---   ---   ---    Old_age   Offline      -       1923
  52. 12 Power_Cycle_Count       0x0000   ---   ---   ---    Old_age   Offline      -       516
  53. 184 Initial_Bad_Block_Count 0x0000   ---   ---   ---    Old_age   Offline      -       17
  54. 195 Program_Failure_Blk_Ct  0x0000   ---   ---   ---    Old_age   Offline      -       0
  55. 196 Erase_Failure_Blk_Ct    0x0000   ---   ---   ---    Old_age   Offline      -       0
  56. 197 Read_Failure_Blk_Ct     0x0000   ---   ---   ---    Old_age   Offline      -       0
  57. 198 Read_Sectors_Tot_Ct     0x0000   ---   ---   ---    Old_age   Offline      -       1328821436
  58. 199 Write_Sectors_Tot_Ct    0x0000   ---   ---   ---    Old_age   Offline      -       1896829555
  59. 200 Read_Commands_Tot_Ct    0x0000   ---   ---   ---    Old_age   Offline      -       16972218
  60. 201 Write_Commands_Tot_Ct   0x0000   ---   ---   ---    Old_age   Offline      -       17268494
  61. 202 Error_Bits_Flash_Tot_Ct 0x0000   ---   ---   ---    Old_age   Offline      -       14028069
  62. 203 Corr_Read_Errors_Tot_Ct 0x0000   ---   ---   ---    Old_age   Offline      -       10935333
  63. 204 Bad_Block_Full_Flag     0x0000   ---   ---   ---    Old_age   Offline      -       0
  64. 205 Max_PE_Count_Spec       0x0000   ---   ---   ---    Old_age   Offline      -       5000
  65. 206 Min_Erase_Count         0x0000   ---   ---   ---    Old_age   Offline      -       10
  66. 207 Max_Erase_Count         0x0000   ---   ---   ---    Old_age   Offline      -       141
  67. 208 Average_Erase_Count     0x0000   ---   ---   ---    Old_age   Offline      -       53
  68. 209 Remaining_Lifetime_Perc 0x0000   ---   ---   ---    Old_age   Offline      -       99
  69. 211 SATA_Error_Ct_CRC       0x0000   ---   ---   ---    Old_age   Offline      -       0
  70. 212 SATA_Error_Ct_Handshake 0x0000   ---   ---   ---    Old_age   Offline      -       0
  71. 213 Indilinx_Internal       0x0000   ---   ---   ---    Old_age   Offline      -       0

  72. Warning! SMART ATA Error Log Structure error: invalid SMART checksum.
  73. SMART Error Log Version: 1
  74. No Errors Logged

  75. Warning! SMART Self-Test Log Structure error: invalid SMART checksum.
  76. SMART Self-test log structure revision number 1
  77. No self-tests have been logged.  [To run self-tests, use: smartctl -t]

  78. Device does not support Selective Self Tests/Logging
Copy the Code
Again appreciate any feedback!

If needed I can post my own output of the same command with my Crucial M500

You have to log in before you can reply Login | Sign Up

Points Rules