Can you set a minimum linux disk buffer size?

Solution 1:

Have a look at /proc/sys/vm/min_free_kbytes. It's the limit of free kbytes that triggers the oom-killer. Also it would be good to check at the logs for the keyword oom-killer in order to know what is being killed {propably you don't want to kill ssh, you it's better to renice it}

Solution 2:

Waiting for the oom-killer to free up memory is a bit like waiting for the engine to stop on your car to tell you when it's time to fill up your gas tank. The oom-killer is a heavy-handed tool of a last resort and desperation for a resource-starved machine. It kills the next program it touches with no consideration for how this will affect your application, reachability, reliability, and so forth. When the oom-killer is invoked, your server is gasping for breath and in critical condition.

Instead, you're much better off taking an active approach at managing your memory usage within your application environment. You can monitor /proc/meminfo for trouble and take appropriate action and throttle back on your workload before a serious situation gets ugly.