Whether it's using Deluge to download torrents, or downloading files from a browser, or cp / mving files, on main Ubuntu 16.04 SSD, when this happens the system tends to lag / freeze / hang for either a long period of time, or short bursts until either the file is entirely written, or entirely downloaded.

I've added:

vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
vm.swappiness = 0

to /etc/sysctl.conf


cat /proc/sys/vm/dirty_background_bytes
cat /proc/sys/vm/dirty_bytes

Some more information is that it's a newer SSD, with 16GB of RAM and at least 8GB of swap, and there is at least 30GB left on the SSD.

Any sort of copying, writing, downloading, torrenting large files (usually over 600MB or if there are multiple files) seems to lead to long lags or short bursts depending on how slow or fast the actual write is.

  • Please install inxi and then post the output of inxi -Fxz so that people get an idea of your system. – DK Bose Jan 24 '19 at 4:17

This is a well known issue called "The pernicious USB-stick stall problem" by LWN.

A suggested workaround is limiting the amount of dirty memory that is accumulated before writing to the device:

echo 0 | sudo tee /proc/sys/vm/dirty_background_bytes
echo 0 | sudo tee /proc/sys/vm/dirty_bytes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.