Transfer speed slows down to a crawl after ~ 10GB transfered

When I transfer files to the newly setup pc for my father, the transfer speed slows to something like 20MiB/s after the first ~ 10GB, and the whole system gets very sluggish. The hdd led on the case is burning fully (no flickering or anything). It stays like that until the transfer is done. CPU and memory usage is low.

Some info about the machine (bit unspecific, as I am not on the machine in question):
Ryzen5, 256GB SSD, manjaro 20.2 XFCE, ext4 (if that is the standard, didn’t change it)

tried thunar, then dolphin: no change
changed source, first smb network share, then usb3 stick: initial transfer speed was the expected maximum for the source, then drop to ~20MiB/s after ~10GB.
changed kernel from the initial one to the latest LTS: no change

So, I am fresh out of ideas what to do next. I would like to solve this though before I post the machine to my father (and want to get it to him by christmas). Does anyone have any idea what to do?

Thanks,
Hilmar

Hi and welcome to the forum :+1:

  1. Unrelated to the way you copy, the most logical explanation would be the fact that buffers are being used which make you think the actual transfer is fast at start.
  2. You should provide info about the hardware of the storage you use as source and destination.
  3. How are you transfering the files?
    Is it a simple copy from 1 HD to another on same machine, or do you use a network connection.

The destination will be the one who will slow down the copy because writes take longer in general as read’s…

1 Like

Yeah, but 20MiB/s is less than 5% of the advertised write speed of the ssd. Thats USB2 territory.
I will go to the actual machine as soon as I can and post some more detailed info.

if you have connected your SSD via USB, i would check the port you use, maybe it operates at USB2.0 only.
(My MB has multiple USB ports but only a few support USB3.1 :wink:)

I have of course not connected my ssd via usb2. It is hanging on a 6GB/s SATA port. All devices and connections I used are well capable of transmitting much faster than the 20MiB/s that I get after a while. So the issue is somewhere else I assume.

some info from inxi:

Machine:
Type: Desktop Mobo: ASUSTeK model: PRIME A320M-K v: Rev X.0x
serial: <superuser/root required> UEFI: American Megatrends v: 5409
date: 01/07/2020

CPU: Info: Quad Core model: AMD Ryzen 5 3400G with Radeon Vega Graphics bits: 64 type: MT MCP L2 cache: 2048 KiB
System:

Drives:
Local Storage: total: 238.47 GiB used: 72.46 GiB (30.4%)
ID-1: /dev/sda vendor: Patriot model: P210 256GB size: 238.47 GiB

Memory:
RAM: total: 13.66 GiB used: 2.41 GiB (17.6%)
Array-1: capacity: 128 GiB note: check slots: 2 EC: None
Device-1: DIMM_A1 size: 8 GiB speed: 2933 MT/s
Device-2: DIMM_B1 size: 8 GiB speed: 2933 MT/s

Host: *** Kernel: 5.4.80-2-MANJARO x86_64 bits: 64
Desktop: Xfce 4.14.3 Distro: Manjaro Linux

Hello @HiGer :wink:

I would suggest to test it without a file manager to see if it is a driver issue or a software issue, maybe, what i also would expect is, that it uses ram cache. However, please run these tests:

It writes 10x100M=1GB

options=("dsync,noatime,nocache" "sync,noatime,nocache" "direct,noatime"); for x in ${options[@]}; do echo -e "\n--- writing with $x ---\n"; time sudo dd if=/dev/zero of=~/test bs=100M count=10 iflag=$x oflag=$x status=progress && echo -e "\n--- reading with $x ---\n"; time sudo dd of=/dev/zero if=~/test bs=100M count=10  iflag=$x oflag=$x status=progress ; done

and

options=("-tT" "-tT --direct"); for x in ${options[@]}; do sudo hdparm $x /dev/sdY; done

:exclamation:Important: Change the path in of= and the device in /dev/sdY

Thank you for that. The output is as follows:

[dieter@dieters-pc ~]$ options=("dsync,noatime,nocache" "sync,noatime,nocache" "direct,noatime"); for x in ${options[@]}; do echo -e "\n--- writing with $x ---\n"; time sudo dd if=/dev/zero of=~/test bs=100M count=10 iflag=$x oflag=$x status=progress && echo -e "\n--- reading with $x ---\n"; time sudo dd of=/dev/zero if=~/test bs=100M count=10  iflag=$x oflag=$x status=progress ; done

    --- writing with dsync,noatime,nocache ---

    [sudo] Passwort für dieter: 
    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 50 s, 21,0 MB/s
    10+0 Datensätze ein
    10+0 Datensätze aus
    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 49,8639 s, 21,0 MB/s

    real	1m0,732s
    user	0m0,022s
    sys	0m1,296s

    --- reading with dsync,noatime,nocache ---

    943718400 Bytes (944 MB, 900 MiB) kopiert, 2 s, 431 MB/s
    10+0 Datensätze ein
    10+0 Datensätze aus
    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2,40066 s, 437 MB/s

    real	0m2,422s
    user	0m0,007s
    sys	0m0,543s

    --- writing with sync,noatime,nocache ---

    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 49 s, 21,4 MB/s
    10+0 Datensätze ein
    10+0 Datensätze aus
    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 48,9128 s, 21,4 MB/s

    real	0m48,940s
    user	0m0,010s
    sys	0m1,267s

    --- reading with sync,noatime,nocache ---

    838860800 Bytes (839 MB, 800 MiB) kopiert, 2 s, 405 MB/s
    10+0 Datensätze ein
    10+0 Datensätze aus
    1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2,51873 s, 416 MB/s

    real	0m2,538s
    user	0m0,008s
    sys	0m0,599s

    --- writing with direct,noatime ---

    dd: konnte '/dev/zero' nicht öffnen: Das Argument ist ungültig

    real	0m0,021s
    user	0m0,015s
    sys	0m0,004s
    dd: konnte '/dev/zero' nicht öffnen: Das Argument ist ungültig

    real	0m0,016s
    user	0m0,009s
    [dieter@dieters-pc ~]$ options=("-tT" "-tT --direct"); for x in ${options[@]}; do sudo hdparm $x /dev/sda; done

    /dev/sda:
     Timing cached reads:   25534 MB in  2.00 seconds = 12789.84 MB/sec
     Timing buffered disk reads: 1154 MB in  3.00 seconds = 384.09 MB/sec

    /dev/sda:
     Timing cached reads:   23886 MB in  2.00 seconds = 11962.59 MB/sec
     Timing buffered disk reads: 1154 MB in  3.00 seconds = 384.42 MB/sec

    /dev/sda:
     multcount     =  1 (on)
     IO_support    =  1 (32-bit)
     readonly      =  0 (off)
     readahead     = 256 (on)
     geometry      = 31130/255/63, sectors = 500118192, start = 0

@HiGer It seems direct did not work… sorry my fault. :wink:

This one works:

options=("dsync,noatime,nocache" "sync,noatime,nocache" "direct,noatime"); for x in ${options[@]}; do echo -e "\n--- writing with $x ---\n"; time sudo dd if=/dev/zero of=~/test bs=100M count=10 oflag=$x status=progress && echo -e "\n--- reading ---\n"; time sudo dd of=/dev/zero if=~/test bs=100M count=10 status=progress ; done

Could you also add:

sudo smartctl -i /dev/sda

Question: Is your home folder on /dev/sda ?

But anyway… it is really strange that it writes so slow…

If it is a SSD, is fstrim.timer enabled and running?

sudo systemctl status fstrim.timer

Yes

[dieter@dieters-pc ~]$ options=("dsync,noatime,nocache" "sync,noatime,nocache" "direct,noatime"); for x in ${options[@]}; do echo -e "\n--- writing with $x ---\n"; time sudo dd if=/dev/zero of=~/test bs=100M count=10 oflag=$x status=progress && echo -e "\n--- reading ---\n"; time sudo dd of=/dev/zero if=~/test bs=100M count=10 status=progress ; done

--- writing with dsync,noatime,nocache ---

[sudo] Passwort für dieter: 
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 3 s, 317 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 3,3054 s, 317 MB/s

real	0m8,850s
user	0m0,017s
sys	0m1,037s

--- reading ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2 s, 503 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2,08543 s, 503 MB/s

real	0m2,099s
user	0m0,007s
sys	0m0,387s

--- writing with sync,noatime,nocache ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 58 s, 18,0 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 58,2784 s, 18,0 MB/s

real	0m58,349s
user	0m0,012s
sys	0m1,264s

--- reading ---

734003200 Bytes (734 MB, 700 MiB) kopiert, 2 s, 344 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2,75594 s, 380 MB/s

real	0m2,775s
user	0m0,010s
sys	0m0,559s

--- writing with direct,noatime ---

838860800 Bytes (839 MB, 800 MiB) kopiert, 6 s, 139 MB/s 
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 6,51875 s, 161 MB/s

real	0m6,627s
user	0m0,016s
sys	0m0,318s

--- reading ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2 s, 498 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 2,1036 s, 498 MB/s

real	0m2,125s
user	0m0,011s
sys	0m0,446s



[dieter@dieters-pc ~]$ sudo smartctl -i /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.80-2-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Patriot P210 256GB
Serial Number:    AA000000000000001153
Firmware Version: S1128B0
User Capacity:    256.060.514.304 bytes [256 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Dec 18 14:31:31 2020 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


[dieter@dieters-pc ~]$ sudo systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● fstrim.service
       Docs: man:fstrim

First i would enable fstrim:

sudo systemctl enable --now fstrim.timer

Maybe this was the issue?

If not, I would expect that there is a problem the low-cost SSD… maybe the controller?

My system have this SSD:

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.81-1-MANJARO] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Apacer AS350 240GB
Serial Number:    519307031A5D00021605
Firmware Version: AP613PE0
User Capacity:    240.057.409.536 bytes [240 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-4 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Dec 18 15:16:40 2020 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

And this test results:

--- writing with dsync,noatime,nocache ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 6 s, 170 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 6,17172 s, 170 MB/s

real	0m8,930s
user	0m0,027s
sys	0m2,292s

--- reading ---

943718400 Bytes (944 MB, 900 MiB) kopiert, 3 s, 281 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 3,72885 s, 281 MB/s

real	0m3,782s
user	0m0,008s
sys	0m1,189s

--- writing with sync,noatime,nocache ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 6 s, 169 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 6,20631 s, 169 MB/s

real	0m6,365s
user	0m0,014s
sys	0m2,413s

--- reading ---

943718400 Bytes (944 MB, 900 MiB) kopiert, 3 s, 283 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 3,69827 s, 284 MB/s

real	0m3,749s
user	0m0,010s
sys	0m1,204s

--- writing with direct,noatime ---

1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 4 s, 246 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 4,26888 s, 246 MB/s

real	0m4,413s
user	0m0,014s
sys	0m0,561s

--- reading ---

838860800 Bytes (839 MB, 800 MiB) kopiert, 3 s, 278 MB/s
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 3,75292 s, 279 MB/s

real	0m3,789s
user	0m0,013s
sys	0m1,222s

I would suggest, if possible, send the SSD back and buy a new one,

Ok, thank you for your support. I guess the system is usable, at least for the purposes of my father. Swapping out the SSD is not an option unfortunately, not enough time and the pc was bought ready made, so not individual parts.

1 Like