Discussion:
Samsung NVMe set up
(too old to reply)
Alan E. Davis via arch-general
2017-06-19 05:21:33 UTC
Permalink
Raw Message
Hello everyone:

I built a new machine with a Samsung SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
950 EVO NVMe M.2 500GB component. Installation went swell. I was able to
use bootctl (by whatever name), which seemed to be easier than using GRUB.
(on the Manjaro wiki was found an extremely coherent discussion of this
system). I have encountered no problems other than slow-ish (if one would
call it that).

When I run hdparm to test the performance of this memory, it falls far
short of the specification of 32 Gb/s. I realize that the Linux kernel has
recently included some code for the NVME drivers. There is also some
question as to the best parameters to use in /etc/fstab.



So I am requesting assistance to set up this device on this mailing list.

I am using the Zen kernel. Some checks I have made:


# hdparm -Tt --direct /dev/nvme0n1

/dev/nvme0n1:
Timing O_DIRECT cached reads: 2404 MB in 2.00 seconds = 1201.67 MB/sec
Timing O_DIRECT disk reads: 5372 MB in 3.00 seconds = 1790.16 MB/sec



# nvme get-feature -f 0x0c -H /dev/nvme0n1p2
get-feature:0xc (Autonomous Power State Transition), Current value:0x000001
Autonomous Power State Transition Enable (APSTE): Enabled
Auto PST Entries .................
Entry[ 0]
.................
Idle Time Prior to Transition (ITPT): 86 ms
Idle Transition Power State (ITPS): 3
.................
Entry[ 1]
.................
Idle Time Prior to Transition (ITPT): 86 ms
Idle Transition Power State (ITPS): 3
.................
Entry[ 2]
.................
Idle Time Prior to Transition (ITPT): 86 ms
Idle Transition Power State (ITPS): 3
.................
Entry[ 3]
.................
Idle Time Prior to Transition (ITPT): 410 ms
Idle Transition Power State (ITPS): 4


Alan Davis
--
[I do not] carry such information in my mind since it is readily
available in books. …The value of a college education is not the
learning of many facts but the training of the mind to think.
---Albert Einstein



"Sweet instruments hung up in cases. . . keep their sounds to themselves."

---Shakespeare, _Timon of Athens_
Sean Greenslade
2017-06-20 00:16:12 UTC
Permalink
Raw Message
Post by Alan E. Davis via arch-general
I built a new machine with a Samsung SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
950 EVO NVMe M.2 500GB component.
Please don't link to ads. A page like this is much more appropriate:

http://www.samsung.com/semiconductor/minisite/ssd/product/consumer/960evo.html
Post by Alan E. Davis via arch-general
Installation went swell. I was able to
use bootctl (by whatever name), which seemed to be easier than using GRUB.
(on the Manjaro wiki was found an extremely coherent discussion of this
system). I have encountered no problems other than slow-ish (if one would
call it that).
When I run hdparm to test the performance of this memory, it falls far
short of the specification of 32 Gb/s.
Where did you get that number? All the specs I see for these drives show
transfer rates in MB/s. You may have confused the read/write specs of
the drive with the link speed of the NVMe / PCIe bus. The two are not
the same.

Also note that the read/write speeds are spec'd as "up to" speeds, so
they are not guaranteeing any minimum speeds. Perhaps I'm just jaded,
but I would be happy to get anything close to a spec-sheet speed on
consumer hardware.
Post by Alan E. Davis via arch-general
I realize that the Linux kernel has
recently included some code for the NVME drivers. There is also some
question as to the best parameters to use in /etc/fstab.
That will depend entirely on the filesystem you choose. Also note that
real-world filesystems rarely do perfectly sequential reads or writes,
so your real world read/write performance will almost certainly be lower
than any HDD test utility shows.

--Sean
Dragon ryu via arch-general
2017-06-20 03:12:00 UTC
Permalink
Raw Message
2017/06/20 午前9:16 "Sean Greenslade" <***@seangreenslade.com>:

A couple of notes:

On Sun, Jun 18, 2017 at 10:21:33PM -0700, Alan E. Davis via arch-general
Post by Alan E. Davis via arch-general
I built a new machine with a Samsung SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_
rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=
CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&
ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
Post by Alan E. Davis via arch-general
SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwjWxp_
rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&cid=
CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269PD9qfp0UjlwQ&
ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=>Samsung
Post by Alan E. Davis via arch-general
950 EVO NVMe M.2 500GB component.
Please don't link to ads. A page like this is much more appropriate:

http://www.samsung.com/semiconductor/minisite/ssd/
product/consumer/960evo.html
Post by Alan E. Davis via arch-general
Installation went swell. I was able to
use bootctl (by whatever name), which seemed to be easier than using GRUB.
(on the Manjaro wiki was found an extremely coherent discussion of this
system). I have encountered no problems other than slow-ish (if one would
call it that).
When I run hdparm to test the performance of this memory, it falls far
short of the specification of 32 Gb/s.
Where did you get that number? All the specs I see for these drives show
transfer rates in MB/s. You may have confused the read/write specs of
the drive with the link speed of the NVMe / PCIe bus. The two are not
the same.

Also note that the read/write speeds are spec'd as "up to" speeds, so
they are not guaranteeing any minimum speeds. Perhaps I'm just jaded,
but I would be happy to get anything close to a spec-sheet speed on
consumer hardware.
Post by Alan E. Davis via arch-general
I realize that the Linux kernel has
recently included some code for the NVME drivers. There is also some
question as to the best parameters to use in /etc/fstab.
That will depend entirely on the filesystem you choose. Also note that
real-world filesystems rarely do perfectly sequential reads or writes,
so your real world read/write performance will almost certainly be lower
than any HDD test utility shows.

--Sean

Also, it is depends on "How you connect NVMe" and "How M/B handles it",
also "what filesystem you use".
Alan E. Davis via arch-general
2017-06-21 18:51:26 UTC
Permalink
Raw Message
Thank you for the helpful information and advice.

I apologize for linking to ads.

How I connect NVMe would affect performance. I see that my assumptions
about the numbers are pretty naive.

Looking at the specs for a pretty fast conventional hard drive, a Hitachi
Ultrastar HUA723020ALA641 , many different numbers jump off the page:

Interface transfer rate: 600MB/s
Interface: 6.0 Gb/s
Media Transfer Rate: 207 MB/s (max)
My Results:
$ sudo hdparm -Tt --direct /dev/sda

/dev/sda:
Timing O_DIRECT cached reads: 680 MB in 2.00 seconds = 339.83 MB/sec
Timing O_DIRECT disk reads: 430 MB in 3.01 seconds = 142.78 MB/sec

For the NVMe drive, I see that it is *up to* 3.2 GB/s, or 3200MB/s, and
this may be "up-to" that speed..

I see also that this depends on many factors. So perhaps I ought to be
happy with these results:
Timing O_DIRECT cached reads: 2506 MB in 2.00 seconds = 1252.75 MB/sec
Timing O_DIRECT disk reads: 5088 MB in 3.00 seconds = 1695.50 MB/sec

I did not see, right of the bat, numbers that are comparable to Media
transfer Rate.

Comparing these numbers: 10X the "direct disk read" speeds is ok with me.

I still don't understand what options would be best in /etc/fstab for the
NVMe M.2 drive. I have noticed various conjectures and ideas about
discards or trim. I don't want to damage the new unit through ignorance.

Thanks.

Alan
Post by Alan E. Davis via arch-general
Post by Alan E. Davis via arch-general
I built a new machine with a Samsung SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSE
wjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&
cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269P
D9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=
Post by Alan E. Davis via arch-general
Samsung
SSD 960 EVO NVMe
<https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSE
wjWxp_rk8nUAhWBfn4KHadiANoYABABGgJwYw&ohost=www.google.com&
cid=CAESEeD2DLyQ7hEOLOBgSPqc9iEd&sig=AOD64_35gPrHU2xXVzC269P
D9qfp0UjlwQ&ctype=5&q=&ved=0ahUKEwi6nZrrk8nUAhUE42MKHXAuDBsQww8ILA&adurl=
Post by Alan E. Davis via arch-general
Samsung
950 EVO NVMe M.2 500GB component.
http://www.samsung.com/semiconductor/minisite/ssd/product/
consumer/960evo.html
Post by Alan E. Davis via arch-general
Installation went swell. I was able to
use bootctl (by whatever name), which seemed to be easier than using
GRUB.
Post by Alan E. Davis via arch-general
(on the Manjaro wiki was found an extremely coherent discussion of this
system). I have encountered no problems other than slow-ish (if one
would
Post by Alan E. Davis via arch-general
call it that).
When I run hdparm to test the performance of this memory, it falls far
short of the specification of 32 Gb/s.
Where did you get that number? All the specs I see for these drives show
transfer rates in MB/s. You may have confused the read/write specs of
the drive with the link speed of the NVMe / PCIe bus. The two are not
the same.
Also note that the read/write speeds are spec'd as "up to" speeds, so
they are not guaranteeing any minimum speeds. Perhaps I'm just jaded,
but I would be happy to get anything close to a spec-sheet speed on
consumer hardware.
Post by Alan E. Davis via arch-general
I realize that the Linux kernel has
recently included some code for the NVME drivers. There is also some
question as to the best parameters to use in /etc/fstab.
That will depend entirely on the filesystem you choose. Also note that
real-world filesystems rarely do perfectly sequential reads or writes,
so your real world read/write performance will almost certainly be lower
than any HDD test utility shows.
--Sean
Also, it is depends on "How you connect NVMe" and "How M/B handles it",
also "what filesystem you use".
--
[I do not] carry such information in my mind since it is readily
available in books. …The value of a college education is not the
learning of many facts but the training of the mind to think.
---Albert Einstein



"Sweet instruments hung up in cases. . . keep their sounds to themselves."

---Shakespeare, _Timon of Athens_
Frederik “Freso” S. Olesen via arch-general
2017-06-21 19:31:54 UTC
Permalink
Raw Message
Post by Alan E. Davis via arch-general
I apologize for linking to ads.
Top post.
Post by Alan E. Davis via arch-general
I still don't understand what options would be best in /etc/fstab for the
NVMe M.2 drive. I have noticed various conjectures and ideas about
discards or trim. I don't want to damage the new unit through ignorance.
Did you have a look at this wiki page:
https://wiki.archlinux.org/index.php/Solid_State_Drives

If you read that (as well as things it links to), you should be pretty
well informed. If you still have more specific questions, ask those. As
has already been said, the "best" /etc/fstab options depend entirely
upon what filesystem you're using and what you're using it for. There's
not a magic set of settings that work the best for everyone (if there
was, it would have been set as the default settings already ;)).
--
Namasté,
Frederik “Freso” S. Olesen <https://freso.dk/>
AUR: https://aur.archlinux.org/account/Freso
Wiki: https://wiki.archlinux.org/index.php/User:Freso
Mauro Santos via arch-general
2017-06-21 21:45:39 UTC
Permalink
Raw Message
Post by Alan E. Davis via arch-general
For the NVMe drive, I see that it is *up to* 3.2 GB/s, or 3200MB/s, and
this may be "up-to" that speed..
You should always be aware of the up to claims but it should be
achievable, even if it is only for large sequential reads.

Another thing you should check is how many lanes are actually connected
or being used to communicate with the nvme ssd. I remember seeing (I
think it was on anandtech but can't find the article) that for some nucs
intel's firmware was not activating all lanes or was operating the lanes
at reduced speed (can't recall exactly), so you might be hitting
something similar.
--
Mauro Santos
Loading...