Skip to content
Calcrivo

SSH Connection Capacity Calculator

Calculate maximum concurrent SSH sessions from MaxSessions and MaxStartups, and estimate memory usage.

Inputs

Typical sshd child process footprint

Practical Max Concurrent Sessions

100

Estimated Memory Usage (MB)

400.0

Theoretical Max (MaxSessions × MaxStartups)

100

Memory at Theoretical Max (MB)

400.0

Max Multiplexed Sessions per TCP Connection

10

Step by step

  1. Values used

    MaxSessions (per TCP connection) = 10; MaxStartups (unauthenticated concurrent) = 10; Expected Concurrent TCP Connections = 10; Memory per Session (MB) = 4

  2. Session capacity

    theoretical_max_sessions = MaxSessions × MaxStartups; memory = sessions × memory_per_session

  3. Practical Max Concurrent Sessions

    = 100

  4. Estimated Memory Usage (MB)

    = 400.0

  5. Theoretical Max (MaxSessions × MaxStartups)

    = 100

  6. Memory at Theoretical Max (MB)

    = 400.0

  7. Max Multiplexed Sessions per TCP Connection

    = 10

How it works

sshd's MaxSessions caps how many multiplexed shell/exec/subsystem sessions can share a single already-authenticated TCP connection, while MaxStartups caps how many unauthenticated connections may be in the login/handshake phase concurrently (beyond that, sshd starts randomly dropping new connections to protect against connection-flood attacks). The theoretical maximum multiplies the two, but the practically useful ceiling is bounded by how many TCP connections actually arrive concurrently — most environments never simultaneously hit both limits at once.

Formula

Session capacity

theoretical_max_sessions = MaxSessions × MaxStartups; memory = sessions × memory_per_session

M_sessions
MaxSessions
M_startups
MaxStartups

Frequently Asked Questions

What happens when MaxStartups is exceeded?

Once unauthenticated connections reach MaxStartups, sshd begins probabilistically refusing new connection attempts (the drop probability ramps up between MaxStartups' three colon-separated values, e.g. 10:30:60, until it hits 100% at the third number) as a defense against connection-flood or brute-force attacks.

Does MaxSessions limit the number of users who can SSH in at once?

No — MaxSessions limits multiplexed sessions (multiple shells/commands) within one already-open SSH connection, not the number of distinct client connections. Two separate users each opening a fresh connection are governed by MaxStartups (pre-auth) and available system resources, not MaxSessions.

Where are MaxSessions and MaxStartups configured?

Both are set in /etc/ssh/sshd_config (`MaxSessions 10`, `MaxStartups 10:30:100`), and require `systemctl reload sshd` (or restart) to take effect on already-running daemons.

You might also need