Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I am having many ssh instances running at once on a server to many client computers, then how are processor time and cores set up?

For example, I have a 2 Core box with lubuntu running on it. How do two client ssh sessions use the cores?

Also, can I physically log in to the box while it is serving 2 remote clients?

Can it have 3 sessions running or is that too many? If so, is there a protocol that would return in text that the server is busy and full of sessions like QOTD? How would I implement this?

And please don't refer this to ServerFault because this computer is not a business server, although it is professional :). (see ServerFault's FAQ).

share|improve this question
4  
This question is of the famous "How long is a piece of string" variety. It all depends on what people are doing in their ssh session. If they run bash, and every once in a while type a shell command the box can probably maintain hundreds of sessions. If you have 5 people, each trying to concurrently compile stuff that might be pushing it. To see how busy it is you can run top interactively, or uptime, which will give you the workload average. – tink Mar 18 at 3:21
I've never seen a SSH server, no matter how pokey have issues with multiple sessions - I've done it on a raspberry pi with 4-5 sessions, web server and so on running. VERY few common tasks need a dedicated processor these days – Journeyman Geek Mar 18 at 3:22
4  
This question has nothing to do with SSH. What matters is what the users are doing, not how they happen to connect to the machine. (Unless you're specifically concerned with the overhead of SSH-specific things like encryption.) – David Schwartz Mar 18 at 3:27

closed as not a real question by techie007, Tog, oKtosiTe, Nifle, slhck Mar 18 at 10:49

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

2 Answers

up vote 3 down vote accepted

You could open 1000 SSH connections to your server and not notice them. Its not the SSH connection, but what processes are being run on them. And yes, you can still log in locally on the machine.

share|improve this answer
Exactly. It's what the users are asking the machine to do that matters, not how the users connect to the machine. – David Schwartz Mar 18 at 3:28
OK, then how many connections would it take to crash the computer and how would that happen? Also, would it be fine if the ssh accounts logged in to check if the server has more than a certain number of accounts? Thank you, by the way. – Blue Ice Mar 18 at 4:09
1  
You dont seem to understand the answer. The number of connections are irrelevant. You can open 1, 3, 1000, or 20000 SSH sessions to your server and it should work just fine. The connection is just a doorway into the server. If the connections are idle, then there is no issue. If each connection is running a program to calculate the value of Pi, thats when the CPU is doing work. – Keltari Mar 18 at 4:18
Right, but if they are all calculating the value of Pi, then would it crash the computer? – Blue Ice Mar 18 at 4:24
Impossible to say. A computer shouldnt crash, it will just get slower and slower... however, if it gets slow enough it might crash. – Keltari Mar 18 at 4:27
show 3 more comments

You can connect simultaneously to a very large number of systems as indicated above - I routinely have 10s of ssh connections open and my system does not bat an eyelid. In fact, other then the initial setup of the connection SSH is extremely frugal on resources.

To answer your question about cores and usage - each session is a separate thread, so on a multicore machine it will balance the sessions between cores - although as others have indicated a single core is quite capable of serving an extremely large number of sessions.

share|improve this answer

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