When a server is under heavy load, new SSH connections may be slow or time out. You can use nice to give your shell higher CPU priority immediately upon login:
ssh -o ConnectTimeout=1 -o ConnectionAttempts=1 user@host "nice -n -20 bash"
ConnectTimeout=1 — Fail fast if the server doesn't respond within 1 secondConnectionAttempts=1 — Only try once (don't waste time retrying)nice -n -20 — Start your shell with the highest CPU scheduling prioritybash — Launch an interactive shell with that prioritynice -n -20 requires root privileges. If you're logging in as a non-root user, use sudo nice -n -20 bash instead, or configure your user with the appropriate permissions.