When my server runs into out-of-memory, it usually kills several applications. Is there any way how can i prevent from killing SSH. Because usually, when this out-of-memory error happens, my SSH is broken like this:
I connect to ssh server.
Enter username
Enter password
and then i wait
i wait
and wait...
and waaaaaaaaaait..
and then: Connection timed out.
Is there any way to prevent this?
The renice command can be used to reset the priority of running processes or control the priority and scheduling of all processes owned by a user. Regular users can only numerically increase process priorities (that is, make tasks less important) using this command, but the root operator can use the full nice range of scheduling (-20 to 19). Lower number is higher priority. Most processes seem to run at nice of 0. If you run CLI top you'll see your running processes. The column labeled NI is the nice number. If you run CLI nice with no parameters you'll see:
Usage:
I suggest you experiment as I have no infinite wisdom as to the right nice value for your purposes.
Raise the niceness. Low-priority apps are killed first.