Ubuntu: Very poor NVME performance



Question:

I first installed Windows and ran a benchmark on the samsung 950 Pro, and saw 2700 MBps read speed. I did this to confirm that the motherboard could use the full x4 lanes with NVME on the boot device.

In ubuntu, I'm seeing write speeds of 170-200MBps.

Distributor ID: Ubuntu  Description:    Ubuntu 16.04.1 LTS  Release:    16.04  Codename:   xenial  

I then did a clean install of ubuntu, and ran a test using this technique. Here is the result:

$ sudo hdparm -Tt /dev/nvme0n1    /dev/nvme0n1:   Timing cached reads:   23880 MB in  2.00 seconds = 11951.14 MB/sec   Timing buffered disk reads: 5194 MB in  3.00 seconds = 1731.18 MB/sec  

Here is the lspci:

$ lspci -vv -s 02:00.0  02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller (rev 01) (prog-if 02 [NVM Express])      Subsystem: Samsung Electronics Co Ltd NVMe SSD Controller      Physical Slot: 2-1      Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+      Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-      Latency: 0, Cache Line Size: 32 bytes      Interrupt: pin A routed to IRQ 39      Region 0: Memory at fb210000 (64-bit, non-prefetchable) [size=16K]      Region 2: I/O ports at e000 [size=256]      Expansion ROM at fb200000 [disabled] [size=64K]      Capabilities: <access denied>      Kernel driver in use: nvme      Kernel modules: nvme  

I did some searching and found a related question here with no answers. Another post, here, has similar problems but no solution.

Any tips on troubleshooting?

Thanks!

Edit: to clarify, write speeds on windows were also blazing, well above 1500MBps


Solution:1

Hmmm the numbers you provide here are way larger than 170-200MB/s. However they are wrong.

In order to bypass the page cache, causing the reads to go directly from the drive into hdparm's buffers (ie "raw" I/O), you need to use the --direct parameter in hdparm. That is:

$ sudo hdparm -Tt --direct /dev/nvme0n1  

That way your results will be lower but close the actual disk's performance.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »