Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.