Skip to content

Instantly share code, notes, and snippets.

@matog
Created September 17, 2020 14:44
Show Gist options
  • Save matog/51b748c69f3f2219a2c386b3e205a005 to your computer and use it in GitHub Desktop.
Save matog/51b748c69f3f2219a2c386b3e205a005 to your computer and use it in GitHub Desktop.
Fix Freezes When Transferring Files Ubuntu

I have found that my Ubuntu Desktop machine will keep pausing/freezing whenever I am transferring a large amount of data to my NFS. Others have experienced this issue when transferring files to a USB stick.

It appears that this has to do with having a very large cache of "dirty files" being held, and when that cache gets too full, your system will "pause" whilst it ensures all that data is actually written to disk. Thus to "fix" this issue, you can reduce your cache size so your system doesn't get overwhelmed to the point where it becomes unusable.

You can implement this immediately with the following

sudo echo $((16*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes
sudo echo $((16*1024*1024)) | sudo tee /proc/sys/vm/dirty_bytes

... however, you would need to run that every time your system reboots. To resolve this issue across reboots, you may wish to add this to your /etc/rc.local file.

echo $((16*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes
echo $((16*1024*1024)) | sudo tee /proc/sys/vm/dirty_bytes

Fuente: https://blog.programster.org/fix-freezes-when-transferring-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment