You are not logged in.

#1 2024-10-18 13:16:06

sobox
Member
Registered: 2024-10-18
Posts: 4

Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

Dear all, I very recently noticed general slowness on tasks that require disk access. I had to unzip an archive that took an usual amount of time and also some update operations on a VM took, seemingly, way too long.

Due to this fact I decide to investigate a bit to know what was going on and if it this slowness was just my impression.

Some important information to start:
- The system is up to date
- I've run the tests with both the latest zen kernel and latest lts
- The laptop is a Dell Inspiron 5490
- The drive is a Samsung PM991 512GB M.2 PCIe NVMe
- fstrim.timer is active
- smartctl does not report any failures
- The drive is encrypted
- The filesystem is ext4
- The tests were made with the charger plugged in and with the performance governor (tlp and autocpu-freq stopped)

After a couple of simple tests with KDiskMark and dd I confirmed the fact that the writes are very slow (~60-80MB/s), next there are some samples.

dd Read:

$ dd if=tempfile of=/dev/null bs=1M count=4096 status=progress iflag=direct

3780116480 bytes (3.8 GB, 3.5 GiB) copied, 5 s, 756 MB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.98182 s, 718 MB/s

dd Write:

$ dd if=/dev/zero of=tempfile bs=1M count=4096 conv=fdatasync,notrunc status=progress oflag=direct

4293918720 bytes (4.3 GB, 4.0 GiB) copied, 71 s, 60.3 MB/s4294967296 bytes (4.3 GB, 4.0 GiB) copied, 71.2006 s, 60.3 MB/s

4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 71.2602 s, 60.3 MB/s

KDiskMark:

                        KDiskMark (3.1.4): https://github.com/JonMagon/KDiskMark
                    Flexible I/O Tester (fio-3.38): https://github.com/axboe/fio
--------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes

[Read]
Sequential   1 MiB (Q=  8, T= 1):  1768.538 MB/s [   1727.1 IOPS] <  4593.59 us>
Sequential 128 KiB (Q= 32, T= 1):  1077.472 MB/s [   8417.8 IOPS] <  3786.16 us>
    Random   4 KiB (Q= 32, T=16):   238.839 MB/s [  59710.6 IOPS] <  2142.03 us>
    Random   4 KiB (Q=  1, T= 1):    36.418 MB/s [   9104.7 IOPS] <   107.87 us>

[Write]
Sequential   1 MiB (Q=  8, T= 1):    76.100 MB/s [     74.3 IOPS] < 114030.13 us>
Sequential 128 KiB (Q= 32, T= 1):    69.948 MB/s [    546.5 IOPS] < 59365.24 us>
    Random   4 KiB (Q= 32, T=16):    33.250 MB/s [   8313.5 IOPS] < 15629.03 us>
    Random   4 KiB (Q=  1, T= 1):    59.525 MB/s [  14881.4 IOPS] <    64.70 us>

Profile: Default
   Test: 1 GiB (x5) [Measure: 5 sec / Interval: 5 sec]
   OS: arch unknown [linux 6.11.3-zen1-1-zen]

I have thought about doing the SSD memory cell clearing that is suggested in the wiki but I would prefer not having to reinstall the whole system.

Can anyone give me an hand in figuring out what is going on?

Thanks to everyone that takes the time to read and respond smile

Last edited by sobox (2024-10-18 13:17:54)

Offline

#2 2024-10-18 14:20:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,175

Re: Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

What encryption are you using and are you using an algorithm that is actually HW accelerated in the processor?

FWIW afaik samsung have been somewhat notorious for issues with power saving, might check whether it helps to disable that: https://wiki.archlinux.org/title/Solid_ … ing_(APST)

Offline

#3 2024-10-18 15:27:30

sobox
Member
Registered: 2024-10-18
Posts: 4

Re: Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

V1del wrote:

What encryption are you using and are you using an algorithm that is actually HW accelerated in the processor?

If I'm not mistaken I'm using dm-crypt with LUKS. This is the setup:

NAME        FSTYPE        SIZE MOUNTPOINT TYPE
nvme0n1                 476.9G            disk
├─nvme0n1p1 vfat          550M /boot      part
└─nvme0n1p2 crypto_LUKS 476.4G            part
  └─root    ext4        476.4G /          crypt

FWIW afaik samsung have been somewhat notorious for issues with power saving, might check whether it helps to disable that: https://wiki.archlinux.org/title/Solid_ … ing_(APST)

Seems that APST is Enabled, I will try to set the kernel parameter to disable this feature and see if anything changes.

Thank you for taking the time to respond.

Offline

#4 2024-10-18 15:33:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,175

Re: Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

I'm more talking about the options you picked from https://wiki.archlinux.org/title/Dm-cry … _LUKS_mode and whether you've ran the benchmark to determine which algo gives you the best speed/safety tradeoffs, as mentioned in: https://wiki.archlinux.org/title/Dm-cry … etup_usage

Offline

#5 2024-10-18 15:52:17

sobox
Member
Registered: 2024-10-18
Posts: 4

Re: Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

I have to say, I don't really remember, it was quite a long time ago.
I'm pretty confident that I've used the default cryptsetup LUKS2 configuration, I don't have any memory of running the benchmark unfortunately.

Anyway this is the result as of now:

# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1       626389 iterations per second for 256-bit key
PBKDF2-sha256    2036069 iterations per second for 256-bit key
PBKDF2-sha512    1478950 iterations per second for 256-bit key
PBKDF2-ripemd160  903944 iterations per second for 256-bit key
PBKDF2-whirlpool  680893 iterations per second for 256-bit key
argon2i       7 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id      7 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b      1280.9 MiB/s      3524.7 MiB/s
    serpent-cbc        128b        87.3 MiB/s       348.2 MiB/s
    twofish-cbc        128b        99.9 MiB/s       185.8 MiB/s
        aes-cbc        256b       486.8 MiB/s      3065.5 MiB/s
    serpent-cbc        256b       109.9 MiB/s       760.3 MiB/s
    twofish-cbc        256b       243.1 MiB/s       187.8 MiB/s
        aes-xts        256b      1559.7 MiB/s      1557.5 MiB/s
    serpent-xts        256b       299.0 MiB/s       658.1 MiB/s
    twofish-xts        256b       385.9 MiB/s       385.5 MiB/s
        aes-xts        512b      2961.4 MiB/s      1580.2 MiB/s
    serpent-xts        512b       309.6 MiB/s       312.4 MiB/s
    twofish-xts        512b       174.9 MiB/s       327.4 MiB/s

From checking the dm-crypt wiki entry I see that the default is aes-xts, so maybe I'm okay here given that serpent and twofish are significantly slower?

Offline

#6 2024-10-18 17:12:46

sobox
Member
Registered: 2024-10-18
Posts: 4

Re: Very slow write speed on Samsung 991 NVMe - Dell Inspiron 5490

Update: I've disabled APST and rerun the benchmark and the results did not change.

Offline

Board footer

Powered by FluxBB