Q:

How to calculate amount of memory needed to keep Linux/ssh responsive?

I have a task receiving daemon that runs on many machines. Arbitrary tasks get sent by clients that are then executed on the server, sometimes taking a little memory and sometimes pushing up to the limit that I set in the daemon's config (tasks will never exceed the limit, even with linux's overcommit behavior). I want to keep the limit as high as possible, so as to allow tasks to run and complete, but not so high that pressing up against the limit the box becomes entirely unresponsive, and not so high that the tasks are actually slowing themselves down by bogging down the box. I want to always be able to ssh in. 
Is there a formula or technique that I could use to determine how big to set the limit? The best idea I have now is to do a fresh boot of the box without any tasks running and check memory usage (not counting cache/buffers) and assume that's what's needed to keep things running. Then I would subtract that from how much physical memory the box has to get the limit.

A:

First of the Answer: There is no easy way to do this.
While it can be done, what you want to do is figure out how much memory your program can use before the system becomes unresponsive. However, this is not just a memory problem, It is a CPU and bandwidth problem as well. Because, even with only a few clients, a super computer would be "unresponsive" to ssh if you were using only a dial-up connection.
The best way to do this is by trial and error. Chose a decent starting point, and add until you start seeing some longer then normal responses.
So if you want a general answer, the system will become unresponsive when it runs completely out of memory and crashes...
Hope this Helps!

