# HDD slow read speed on FreeBSD 10.1



## venom (Jun 8, 2015)

I have problem - slow disk read speed

`# uname -a`

```
FreeBSD anonymous 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```

`# diskinfo -v ada0`

```
ada0
    512             # sectorsize
    1000204886016    # mediasize in bytes (932G)
    1953525168     # mediasize in sectors
    0               # stripesize
    0               # stripeoffset
    1938021         # Cylinders according to firmware.
    16             # Heads according to firmware.
    63             # Sectors according to firmware.
    9XG77D3E       # Disk ident.
```

`# camcontrol identify ada0`

```
pass4: <ST91000640NS SN03> ATA-8 SATA 3.x device
pass4: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-8 SATA 3.x
device model          ST91000640NS
firmware revision     SN03
serial number         9XG77D3E
WWN                   5000c5007913f409
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 512, offset 0
LBA supported         268435455 sectors
LBA48 supported       1953525168 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA6
media RPM             7200

Feature                      Support  Enabled   Value           Vendor
read ahead                     yes    yes
write cache                    yes    yes
flush cache                    yes    yes
overlap                        no
Tagged Command Queuing (TCQ)   no    no
Native Command Queuing (NCQ)   yes        32 tags
NCQ Queue Management           no
NCQ Streaming                  no
Receive & Send FPDMA Queued    no
SMART                          yes    yes
microcode download             yes    yes
security                       yes    no
power management               yes    yes
advanced power management      no    no
automatic acoustic management  no    no
media status notification      no    no
power-up in Standby            no    no
write-read-verify              yes    no    0/0x0
unload                         no    no
general purpose logging        yes    yes
free-fall                      no    no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA)      yes      no      1953525168/1953525168
HPA - Security                 no
```


`# pciconf -lv`

```
***
ahci0@pci0:0:31:2:      class=0x010601 card=0x063615d9 chip=0x1d028086 rev=0x06 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'C600/X79 series chipset 6-Port SATA AHCI Controller'
    class      = mass storage
    subclass   = SATA
```

`# dmesg | grep ada0`

```
ada0 at ahcich0 bus 0 scbus3 target 0 lun 0
ada0: <ST91000640NS SN03> ATA-8 SATA 3.x device
ada0: Serial Number 9XG77D3E
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
ada0 at ahcich0 bus 0 scbus3 target 0 lun 0
ada0: <ST91000640NS SN03> ATA-8 SATA 3.x device
ada0: Serial Number 9XG77D3E
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
```

`# camcontrol devlist | grep pass4`

```
<ST91000640NS SN03>                at scbus3 target 0 lun 0 (ada0,pass4)
```

`#  cat /dev/ada0 | pv -brt > /dev/null`

```
503MiB 0:00:09 [57.3MiB/s]
950MiB 0:00:17 [61.2MiB/s]
```

Speed on Linux
120MiB/s

Please help me


----------



## dehrmann (Jun 8, 2015)

Try using `dd if=/dev/ada0 bs=1M count=1024 | pv -brt > /dev/null` instead. `cat` might not do efficient block operations.


----------



## kpa (Jun 8, 2015)

Disk device nodes under /dev in FreeBSD are unbuffered unlike in Linux where some of them have internal buffering. Your application that tests the read/write speeds of the disks has to implement its own buffering to match what Linux is doing.


----------



## venom (Jun 11, 2015)

`# dd if=/dev/ada0 bs=1M count=1024 | pv -brt > /dev/null`

```
1GiB 0:00:18 [54.2MiB/s]
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 18.908714 secs (56785555 bytes/sec)
```


----------

