Ubuntu – NVMe SSD slow write speed

kernelnvmepcieperformancessd

I have a NUC (BEH model) and a M.2 SSD PCIe gen3 NMVe card (Samsung 970 pro 512GB) and I have a slow and fast write speed result in Ubuntu 18.04.3 with two different kernels. I used ukuu for kernel switching and in kernel 5.0+ which comes standard with the Ubuntu installer I get around 600MiB ( sad ) write speed and with a previous kernel version of 4.9.190, I get around 2200MiB with the benchmark tool in Ubuntu. I have tried the latest 5.2 kernel and it is still a problem. I have tried Linux mint 19.2 and I also get the a slow write speed because it is using a later kernel than 4.9.

Here is my benchmark result on kernel 4.9.190.

I think this and this are related problems and a simple google search indicates lots of SSD write performance issues. Could it be a massive potential linux kernel performance issue?

Any help or fix would be greatly welcome!

Best Answer

It seems that the kernel itself might be ok but somewhere in the benchmark tool (Disks) of ubuntu could be the issue.

Solution (work-around): I created a directory in the disk to be tested and then terminal into the directory and ran two commands on it. The first commands creates a temp file (4GB in size) and tests the write speed of the disk and the second command reads that file and tests the read speed.

The commands: -write: dd if=/dev/zero of=tempfile bs=1M count=4096 conv=fdatasync,notrunc status=progress oflag=direct -read: dd if=tempfile of=/dev/null bs=1M count=4096 status=progress iflag=direct

Here is my result: terminal command results

Related Question