0

When CentOS 7 free memory goes below 200 MB, it become unresponsive even to ssh connection.

Currently I have many machines not accessible remotely in peak time due to free memory being between 80 MB to 110 MB.

# free -m
              total        used        free      shared  buff/cache   available
Mem:           7745        7520          98           2         126          59
Swap:          7935        7935           0

How to keep CentOS 7 responsive to new ssh logins even when its under heavy load?

in other words: if by tweaking sshd config I can access the machine no matter how busy its, then please share you insight.

  • 3
    Are you sure the problem is about how much free memory you have and not about how much swap you are using? – terdon Apr 3 '17 at 13:17
  • 1
    If you prevent the system using its last 200MB, how is that different from just physically removing that memory? By extension, why is that different from adding 400MB memory and still blocking the last 200MB? By final extension how is that different from what you have now? – roaima Apr 3 '17 at 23:31
  • 1
    My point being that you presumably don't really want to block the last 200MB memory, but rather you want to reserve it for some as-yet unspecified purpose. Which is...? – roaima Apr 3 '17 at 23:32
  • 1
    Renice 'sshd' to -9 and reserve the memory it needs, then it should let you in as soon as it notices you trying to connect. – Mioriin Apr 5 '17 at 15:13
  • 1
    Add Nice=-9 to the [Service] section of sshd.service to renice it to -9. I'm not putting it as a proper answer since it's probably not the best idea to try to fix your problem like that. – Mioriin Apr 5 '17 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.