External NVMe slow once?

aliquo93

New Member
Joined
Jan 20, 2021
Messages
11
Reaction score
2
Credits
104
I’ve bought an external NVMe and the first time I’ve tried to copy a (large) folder it was super slow.

I’ve immediately thought of some defects but smartctl doesn’t report anything wrong, then I’ve tried again to copy (multiple times) the same folder and other files and now it’s super fast as it should be. What could have been the problem the first time? I didn’t have any program in background eating resources when I tried and I have a very powerful PC (AMD Ryzen 9 5900HX).

I’m on Kubuntu 22.04 with latest 6.2.7 kernel and I’ve always tried with the same USB port which is an USB 3.0 type.
 


Speed up USB Transfers

Add to /etc/systctl.conf - need to be in root

Code:
echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

Save and reboot should have faster transfers
or you can try

Code:
sudo echo $((64*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes
sudo echo $((192*1024*1024)) | sudo tee /proc/sys/vm/dirty_bytes


Also to ensure this fix stays after reboots add the following to your /etc/rc.local file, if it doesn't exist, simply create it.

Code:
echo $((64*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes
echo $((192*1024*1024)) | sudo tee /proc/sys/vm/dirty_bytes


Then make the rc.local file executable
Code:
chmod +x /etc/rc.local


Check everything works:
Code:
sudo systemctl restart rc-local
sudo systemctl status rc-local
 
Last edited by a moderator:

Staff online


Top