Wednesday, September 19, 2007

running out of memory when copying large files

From coraid support:

5.19 Q: How can I avoid running out of memory when copying large files?

A: You can tell the Linux kernel not to wait so long before writing data out to backing storage.

echo 5 > /proc/sys/vm/dirty_ratio
echo 5 > /proc/sys/vm/dirty_background_ratio

These settings are even tighter and should help even on a system that is doing a large amount of larger-than-RAM data transfers.

echo 3 > /proc/sys/vm/dirty_ratio
echo 3 > /proc/sys/vm/dirty_background_ratio
echo 5120 > /proc/sys/vm/min_free_kbytes