# slow SSD

## Cr0t

I am supposed to get 500mb/s, but I barely hit 250. I got trim enabled.

Any ideas?

```
sync ; echo 3> /proc/sys/vm/drop_caches ; iozone -b -R -i 0 -i 2 -f ./iozone.file -r 32 -s 4g

   Iozone: Performance Test of File I/O

           Version $Revision: 3.408 $

      Compiled for 64 bit mode.

      Build: linux-AMD64 

   Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins

                Al Slater, Scott Rhine, Mike Wisner, Ken Goss

                Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,

                Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,

                Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,

                Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,

                Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer.

                Ben England.

   Run began: Sun Nov 11 08:05:45 2012

   Record Size 32 KB

   File size set to 4194304 KB

   Command line used: iozone -b -R -i 0 -i 2 -f ./iozone.file -r 32 -s 4g

   Output is in Kbytes/sec

   Time Resolution = 0.000001 seconds.

   Processor cache size set to 1024 Kbytes.

   Processor cache line size set to 32 bytes.

   File stride size set to 17 * record size.

                                                            random  random    bkwd   record   stride                                   

              KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread

         4194304      32  261973  261545                   2058756  150105                                                          

iozone test complete.

Excel output is below:

"Writer report"

        "32"

"4194304"   261973 

"Re-writer report"

        "32"

"4194304"   261545 

"Random read report"

        "32"

"4194304"   2058756 

"Random write report"

        "32"

"4194304"   150105 

[    2.101465] sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)

[    2.181609] sd 0:0:0:0: [sda] Write Protect is off

[    2.181612] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

[    2.181632] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

[    2.183546]  sda: sda1 sda2

[    2.184103] sd 0:0:0:0: [sda] Attached SCSI disk

[    5.700865] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities

[    5.792316] EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities

[    5.835287] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)

[   16.052579] EXT4-fs (sda2): re-mounted. Opts: discard

[   16.250445] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem

[   16.251367] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)

[   41.717980] EXT4-fs (sda2): re-mounted. Opts: discard,commit=0

[    1.958845] ata1.00: ATA-8: KINGSTON SH103S3120G, 503ABBF0, max UDMA/133

[    2.074799] scsi 0:0:0:0: Direct-Access     ATA      KINGSTON SH103S3 503A PQ: 0 ANSI: 5
```

----------

## eccerr0r

Curious what does "hdparm -tT /dev/sda" say?

I've not tried through-the-filesystem SSD benchmarks but a lot of the benchmarks out there are not through the filesystem either, it's just raw throughput to the disk.

Also I am a bit biased as I don't own non-Intel SATA3 (6Gb) interfaces yet (I'm using a Z68 and a Z77) and both of these are able to get > 500MB/sec to my SSDs (a Crucial M4-series and an Intel 520-series).

----------

## Cr0t

 *eccerr0r wrote:*   

> Curious what does "hdparm -tT /dev/sda" say?
> 
> I've not tried through-the-filesystem SSD benchmarks but a lot of the benchmarks out there are not through the filesystem either, it's just raw throughput to the disk.
> 
> Also I am a bit biased as I don't own non-Intel SATA3 (6Gb) interfaces yet (I'm using a Z68 and a Z77) and both of these are able to get > 500MB/sec to my SSDs (a Crucial M4-series and an Intel 520-series).

 

```
sync ; echo 3> /proc/sys/vm/drop_caches ; hdparm -tT /dev/sda ; sync ; echo 3> /proc/sys/vm/drop_caches ; hdparm -tT /dev/sda ; sync ; echo 3> /proc/sys/vm/drop_caches ; hdparm -tT /dev/sda 

/dev/sda:

 Timing cached reads:   1842 MB in  2.00 seconds = 920.94 MB/sec

 Timing buffered disk reads: 696 MB in  3.01 seconds = 231.45 MB/sec

/dev/sda:

 Timing cached reads:   1864 MB in  2.00 seconds = 931.31 MB/sec

 Timing buffered disk reads: 700 MB in  3.01 seconds = 232.92 MB/sec

/dev/sda:

 Timing cached reads:   1862 MB in  2.00 seconds = 931.06 MB/sec

 Timing buffered disk reads: 700 MB in  3.01 seconds = 232.83 MB/sec
```

It is an 8 core xeon system, 8gb of ram and i am using ahci.

----------

## eccerr0r

What chipset, and do you have SATA3 (6Gb/s) ports?  (also, which Xeon?)

Guessing from your cached read speeds either you have something really configured wrong or your motherboard does not support sata3...  SATA2 (3Gb/s) will suspiciously top out at around 250MB/sec ...

hmm... reminded me of this thread https://forums.gentoo.org/viewtopic-t-925798.html ...

----------

## Cr0t

 *eccerr0r wrote:*   

> What chipset, and do you have SATA3 (6Gb/s) ports?  (also, which Xeon?)
> 
> Guessing from your cached read speeds either you have something really configured wrong or your motherboard does not support sata3...  SATA2 (3Gb/s) will suspiciously top out at around 250MB/sec ...
> 
> hmm... reminded me of this thread https://forums.gentoo.org/viewtopic-t-925798.html ...

 

```
00:00.0 Host bridge: Intel Corporation 5000X Chipset Memory Controller Hub (rev 12)

00:02.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 2 (rev 12)

00:03.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 3 (rev 12)

00:04.0 PCI bridge: Intel Corporation 5000X Chipset PCI Express x16 Port 4-7 (rev 12)

00:05.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 5 (rev 12)

00:06.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 6 (rev 12)

00:07.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 7 (rev 12)

00:10.0 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev 12)

00:10.1 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev 12)

00:10.2 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev 12)

00:11.0 Host bridge: Intel Corporation 5000 Series Chipset Reserved Registers (rev 12)

00:13.0 Host bridge: Intel Corporation 5000 Series Chipset Reserved Registers (rev 12)

00:15.0 Host bridge: Intel Corporation 5000 Series Chipset FBD Registers (rev 12)

00:16.0 Host bridge: Intel Corporation 5000 Series Chipset FBD Registers (rev 12)

00:1c.0 PCI bridge: Intel Corporation 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 (rev 09)

00:1d.0 USB controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #1 (rev 09)

00:1d.1 USB controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 (rev 09)

00:1d.2 USB controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 (rev 09)

00:1d.3 USB controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 (rev 09)

00:1d.7 USB controller: Intel Corporation 631xESB/632xESB/3100 Chipset EHCI USB2 Controller (rev 09)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d9)

00:1f.0 ISA bridge: Intel Corporation 631xESB/632xESB/3100 Chipset LPC Interface Controller (rev 09)

00:1f.1 IDE interface: Intel Corporation 631xESB/632xESB IDE Controller (rev 09)

00:1f.2 SATA controller: Intel Corporation 631xESB/632xESB SATA AHCI Controller (rev 09)

00:1f.3 SMBus: Intel Corporation 631xESB/632xESB/3100 Chipset SMBus Controller (rev 09)

01:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Upstream Port (rev 01)

01:00.3 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express to PCI-X Bridge (rev 01)

02:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E1 (rev 01)

02:01.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E2 (rev 01)

05:0b.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X Fusion-MPT SAS (rev 01)

07:00.0 VGA compatible controller: NVIDIA Corporation NV45GL [Quadro FX 3400/4400] (rev a2)

0b:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5752 Gigabit Ethernet PCI Express (rev 02)

0c:02.0 Multimedia audio controller: C-Media Electronics Inc CMI8738/CMI8768 PCI Audio (rev 10)

0c:0a.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]

vendor_id   : GenuineIntel

cpu family   : 15

model      : 6

model name   : Intel(R) Xeon(TM) CPU 3.73GHz

stepping   : 4

microcode   : 0x2

cpu MHz      : 3200.000

cache size   : 2048 KB

physical id   : 0

siblings   : 4

core id      : 0

cpu cores   : 2

apicid      : 0

initial apicid   : 0

fpu      : yes

fpu_exception   : yes

cpuid level   : 6

wp      : yes

flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc pebs bts nopl pni dtes64 monitor ds_cpl vmx est cid cx16 xtpr pdcm lahf_lm tpr_shadow

bogomips   : 7447.74

clflush size   : 64

cache_alignment   : 128

address sizes   : 36 bits physical, 48 bits virtual

power management:
```

----------

## Cr0t

 *eccerr0r wrote:*   

> What chipset, and do you have SATA3 (6Gb/s) ports?  (also, which Xeon?)
> 
> Guessing from your cached read speeds either you have something really configured wrong or your motherboard does not support sata3...  SATA2 (3Gb/s) will suspiciously top out at around 250MB/sec ...
> 
> hmm... reminded me of this thread https://forums.gentoo.org/viewtopic-t-925798.html ...

 The drive is suppose to go up to 500mb/s... it's just SATA2.

*UPDATE* 240-260mb/s on sata2 maxed out.

----------

## eccerr0r

Seems like the drive is bottlenecked by the SATA2.  SATA2 is 3Gb/sec, that's 3Gbits/sec or around 300MBytes/sec (I usually use 10:1 ratio to account for serial overhead and ease of calculation, it's probably not THAT bad in real life but it's a rough guess).  After this 300MB/sec limit I have to tack on another couple percent to get raw to-disk rates.  I found that my ATA66 controllers top out around 50MB/sec and use a similar ratio with the 300MB/sec which gets me the 225-250MB/sec limit, which is about what you're seeing.

Sounds like you need to get SATA3 (6Gb/sec) controllers to realize the full speed of the disk.  I don't even see the 500MB/sec through my Z68 board with SATA3 controllers through hdparm, but it clearly shows in gnome-disk-utility... pretty dang fast.

----------

## Cr0t

did some more work...

```
sync ; echo 3> /proc/sys/vm/drop_caches ; iozone -b -R -i 0 -i 2 -f ./iozone.file -r 32 -s 4g

   Iozone: Performance Test of File I/O

           Version $Revision: 3.408 $

      Compiled for 64 bit mode.

      Build: linux-AMD64 

   Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins

                Al Slater, Scott Rhine, Mike Wisner, Ken Goss

                Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,

                Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,

                Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,

                Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,

                Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer.

                Ben England.

   Run began: Tue Nov 13 08:18:21 2012

   Record Size 32 KB

   File size set to 4194304 KB

   Command line used: iozone -b -R -i 0 -i 2 -f ./iozone.file -r 32 -s 4g

   Output is in Kbytes/sec

   Time Resolution = 0.000001 seconds.

   Processor cache size set to 1024 Kbytes.

   Processor cache line size set to 32 bytes.

   File stride size set to 17 * record size.

                                                            random  random    bkwd   record   stride                                   

              KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread

         4194304      32  269725  298592                   2381634  293505                                                          

iozone test complete.

Excel output is below:

"Writer report"

        "32"

"4194304"   269725 

"Re-writer report"

        "32"

"4194304"   298592 

"Random read report"

        "32"

"4194304"   2381634 

"Random write report"

        "32"

"4194304"   293505

/dev/sda:

 Timing cached reads:   1834 MB in  2.00 seconds = 916.90 MB/sec

 Timing buffered disk reads: 808 MB in  3.00 seconds = 268.89 MB/sec

/dev/sda:

 Timing cached reads:   1836 MB in  2.00 seconds = 917.86 MB/sec

 Timing buffered disk reads: 806 MB in  3.00 seconds = 268.41 MB/sec

/dev/sda:

 Timing cached reads:   1858 MB in  2.00 seconds = 928.86 MB/sec

 Timing buffered disk reads: 806 MB in  3.00 seconds = 268.64 MB/sec

blockdev ra: 4096

sda queue/read_ahead_kb : 2048

sda queue/nr_requests : 2048

sda device/queue_depth : 31

sda queue/max_sectors_kb : 2048
```

----------

## Cr0t

FIXED

----------

