Performance/speed of Rock Pi 4 NVMe 256GB Lenovo M.2 SSD

Hi All

sudo hdparm -t /dev/nvme0n1p1
[sudo] password for rock:

/dev/nvme0n1p1:
 Timing buffered disk reads: 964 MB in  3.00 seconds = 321.08 MB/sec

How can I increase the performance of the NVMe 256GB Lenovo M.2 SSD? 320MB/s is pathetic…
Key information about my system:

Rock Pi 4 Model B 4GB
Ubuntu Server 18.04 aarch64 GNU/Linux

uname -r
4.4.154-104-rockchip-g3037f71a0de7

cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Any pointers are much appreciated! Thank you all.

Do a more serious test benchmark.
What is specification of drive and real world test also post those.

This is two low even in pcie gen1 mode. You can try to enable the pcie gen2 mode.

Check:

1 Like

I will look at Jack’s post next, but first I agree i should add some more numbers:

hdparm -Tt /dev/nvme0n1

/dev/nvme0n1:
 Timing cached reads:   2130 MB in  2.00 seconds = 1064.81 MB/sec
 Timing buffered disk reads: 1364 MB in  3.00 seconds = 454.19 MB/sec

dd performance:

  • write zeroes:

    sync; dd if=/dev/zero of=/perf/tempfile.zero bs=1M count=1024; sync
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.7368 s, 392 MB/s

  • read back:

    sudo /sbin/sysctl vm.drop_caches
    vm.drop_caches = 0
    sudo /sbin/sysctl -w vm.drop_caches=3
    vm.drop_caches = 3
    dd if=/mnt/cardano/test/perf/tempfile.zero of=/dev/null bs=1M count=1024
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.05381 s, 523 MB/s

The NVMe flash in question is a Lenovo 256GB PCI3.0x4 Modelnr 4XB0P01014.

1 Like

Hi @jack, thanks for that link!
I have updated the configuration following the instructions on the page. After a -planned- next reboot I will revisit this page to update with results. Have a great weekend.

I wonder …
I have the same dismal performance
BTW the comment about ‘real benchmarks’ is only valid id you are looking at ‘real performance’
The dd or hdparm method gives a good feel of what you are measuring.
I have done all the overlay stuff to enable gen-2 mode
I followed the wiki to flash SPI-flash. All went well inckuding a string of ‘wrote block NN’
It does not boot from SPI
There is no /dev/mtd…
Could the ‘no gen-2’ and ‘no SPI flash’ be related and be overlay is not working?
James

I’m glad I’m not the only one then. I’m on the latest kernel from test repo and gen-2 pcie overlay had a near zero impact… So I would speculate it’s to actually working as intended… But I don’t know how to fix it unfortunately.

Any fix? Did you contact RockPI staff to ask them? Suggest to do that maybe they can help

That won’t do what you think it will do. Because you are writing to a filesystem, what you are really doing, is clearing the disk buffers (kernel), filling the buffers, writing ONLY the overflow, and getting the timing based on that. It doesn’t account for the final sync time, which will make the time lower than it really is. What you should do is more like this;

sync
time (dd if=blah; sync)

And then you take (bytes / real time) to calculate actual speed.

It will be a lot more accurate, but still not good. You really need to do your tests directly onto bare metal. And further, don’t forget to trim the filesystem/disk before running your benchmarks, otherwise the writes will be far slower than they should be since you’re not just writing data, you’re wiping the space clean first.

3 Likes

@fatjoez, I haven’t contacted them, because I can live with the issue at the moment. I was hoping a kernel update might improve the performance, but not so far.

Interestingly, I found an article of someone turning on PCI Gen 2 mode and actually roughly doubling their NVMe performance. I’m going to have another look at that and check if I actually got it right.

https://fossbytes.com/rock-pi-4-with-m-2-extender-nvme-drive-performance/