Reserve/Lock memory for ssh on Ubuntu?
Is it possible to lock/reserve memory and cpu priority for ssh/auth and bash operations? Because when server is overflowed i can't connect via ssh, because it's freezes on ssh auth.
Maybe somehow limit maximum allowed overall memory usage and processor power?
Solution 1:
You'll find that re-nice'ing the parent sshd process won't help, because it will wind up spawning the child process for your connection with the priority at 0.
What you should look into is adding a command in ~/.ssh/rc. Anything in that file is executed at the login sequence, and hopefully you'll have enough resources to get that far. You can enter something like this:
ps -o pid --no-heading | xargs renice -10 > /dev/null
HTH
-SM