Fix Freezes When Transferring Files
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 $((64*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes sudo echo $((192*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
echo $((64*1024*1024)) | sudo tee /proc/sys/vm/dirty_background_bytes echo $((192*1024*1024)) | sudo tee /proc/sys/vm/dirty_bytes
- Unix & Linux - Why is my PC freezing while I'm copying a file to a pendrive?
- Ask Ubuntu - System freezes/unresponsive/unusable when copying large file to USB
First published: 16th August 2018