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

I have a network of 100 machines.

Is there a limit to the number of machines that can connect to one single machine (at the same time)?

For example, can I have 99 of my machines maintain continuous ssh connection to the 100th machine? Can I have every one of my machines (every one of the 100) maintain a continuous ssh connection to all other 99 machines?

How much memory does each such a connection take?

share|improve this question
What is your need exactly? – ℝaphink Apr 4 '11 at 15:43
I want to be able to write/read data to each one of the nodes, FAST. – user76976 Apr 4 '11 at 15:44
Why not use a distributed FS, that's faster and more reliable than using tons of SSH connections... – ℝaphink Apr 4 '11 at 15:45
There are obvious resource requirements for each connection and you may have to tweak the odd setting dependant on your distribution but you should be able to open and maintain all these connection yes. That said I don't know why you'd think that doing it this way was quick or wise to be honest. – Chopper3 Apr 4 '11 at 15:48
@Raphink: any recommendation for a good distributed FS? – user76976 Apr 4 '11 at 16:07
up vote 1 down vote accepted

Is there a limit to the number of machines that can connect to one single machine (at the same time)?

It will ultimately be limited by a number of factors - max open files, available memory and more - but 100 connections is not a huge amount.

To restrict the number of connection, use connlimit option in iptables.

If you want to measure how much memory each connection uses (on average) then start recording the number of connections and plot it against the free memory (less buffers+cache).

share|improve this answer
thank you @symcbean. – user76976 Apr 4 '11 at 16:23

We use login servers to start lots of sessions to/from. The thing that maxes it out is the actually bash/shell sessions not the ssh connection per se. We use a very long "history" for each session ( history -a rules ) and that is what really chews up the memory. So no there should not be a limit but there could be practical limits due to running lots of shell sessions. An ssh connection itself is about half the size compared to bash (YMMV ) From a jump box using ( a very handy memory usage sorter )

Private + Shared = RAM used Program

23.8 MiB + 13.4 MiB = 37.1 MiB sshd (17)

63.1 MiB + 1.6 MiB = 64.7 MiB bash (19)

share|improve this answer
thank you. Can you explain your calculations? How much memory should I expect to be consuming for 100 ssh connections? (I do not need long history, just the ability to execute commands on each remote machine) – user76976 Apr 4 '11 at 16:05

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.