# How to debug hard drive performance problem?



## dehrmann (Jun 8, 2015)

I have an SSD that's rated for around 400MB/s read, but delivers more like 140MB/s. I realized this could just be saturating a 1.5Gb/s SATA 1 link. The SATA controller is a PCIE (hopefully) v2.x, x2. I'd like to check to see that the controller-drive interface is SATA III, and that the PCIE-controller interface is v2.x x2, and that neither autonegotiated down to a slower speed, possibly because of old cables. How can I do this?

The command I'm testing read throughput with is `dd if=/dev/adaX bs=16M | pipebench > /dev/null`.


----------



## junovitch@ (Jun 9, 2015)

Look in `dmesg` for the drive information.

I was hoping their would be something in camcontrol(8), however after a brief look at the man page I didn't see anything that stood out as helpful.

Also `smartctl -a /dev/<drive>` from sysutils/smartmontools may be helpful.  Among other things, it would show this:

```
SATA Version is:  SATA 2.6, 3.0 Gb/s
```


----------



## dehrmann (Jun 9, 2015)

I wonder if the version `smartctl` reports is the version supported or the version in use. I'll look into `dmesg` output.


----------



## dehrmann (Jun 9, 2015)

Ah! I got this from `smartctl` (I'm guessing "current" is what it sounds like):


```
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
```

On to PCIE?


----------



## junovitch@ (Jun 9, 2015)

Well, something to keep in mind:
HDD slow read speed on FreeBSD 10.1

I'm not sure what the best benchmarking recommendation is for disks.


----------



## wblock@ (Jun 11, 2015)

For raw read speed, `diskinfo -tv ada0` is functionally equivalent to reading with `dd`.  That number is the fastest the SSD can go, but not very important for real-world use.  The essentially zero access time of an SSD is usually the important feature.


----------

