2

How to view and enable Write Cache in M.2 PCIe NVMe Samsung SSD 950Pro in Ubuntu?

Currently I am getting very very poor write speed in Ubuntu 20.04 LTS which I newly installed. The Same M.2 NVMe SSD with Windows 10 OS the bench mark is pretty good.

I am using AMD FX8350 / 32 GB of RAM / asus 970 pro gaming aura.

I tried with NVMe-cli utility and Samsung DC tool kit

Samsung DC tool kit is not supporting few features for NVMe. NVMe-CLI is not supporting few.

Drive settings are grayed out in gnome-disks tool

Am not sure if the write cache is the problem or something else. Any help is much appreciated

Regards,

Disk

Ubuntu Benchmark and Windows Benchmark

1 Answer 1

2

I believe it is enabled by default. You can check it:

cat /sys/block/nvme0n1/queue/write_cache
write back

Probably this is optimal setting

Write through caching:
When the controller receives a write request from the host, it stores the data in its cache module, writes the data to the disk drives, then notifies the host when the write operation is complete. This process is calles write-trough caching because the data actually passes through-and is stored in- the cache memory on its way to the disk drives.

Write back caching:
This caching technique improves the subsystem's response time to write requests by allowing the controller to declare the write operation 'complete' as soon as the data reaches its cache memory. The controller performs the slower operation of writing the data to the disk drives at a later time.


In most cases nvme ssds has built in ddr cache like 500MB or 1GB (probably managed by disk firmware if not let's someone correct me because maybe that's the problem)

You can check if trim is working as expected by manually executing sudo fstrim -av and test write speed in real life by copying and pasting big file and measure time taken.

But there are still slow writes and it seems like these are handling in this way by kernel itself (maybe some reliability syncing):
SSD slow write speed on Ubuntu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .