I'd like to ask about how much memory an SSH connection should take typically. Here is how I'm finding out how much of a RAM hit is incurred:

Kindly don't get vehement that I'm using a GoDaddy shared hosting plan or cPanel. When nothing is running, cPanel reports 0 MB of RAM in use. When I SSH into my (1GB, 2 CPU) shared hosting, cPanel suddenly reports around 490 MB of RAM in use.

(Also, I literally obliterated all PHP files in the public folder to eliminate the chance this is due to robot crawling. I read https://serverfault.com/questions/449296/why-is-linux-reporting-free-memory-strangely, but it doesn't help.)

No connections:


After SSH'ing into my account:


ps aux output:

login as: user123
user123@xxxx.com's password:
user123@a2plcpnl0490 [~]$ ps aux
user123   675171  0.0  0.0 138652  1492 ?        S    11:09   0:00 pure-ftpd (ID
user123   678698  0.0  0.0 191408  9132 ?        S    11:25   0:00 /usr/bin/php
user123   679664  0.0  0.0 104632  1832 ?        S    11:29   0:00 sshd: user123@
user123   679666  0.0  0.0  11476  1636 pts/0    Ss   11:29   0:00 -bash
user123   679759  0.0  0.0  13380  1028 pts/0    R+   11:30   0:00 ps aux
user123@a2plcpnl0490 [~]$

My question is, how much RAM should an SSH connection take? Is around 500 MB typical?

GoDaddy support says, "That's the way it is. Get VPS." Is that really right??

  • @drewbenn It's always between 480 MB and 495 MB (SSH open), or 0 (SSH closed). There is no grey area. Never more, never less. Nothing is running that would eat up that RAM. – Drakes Jan 18 '16 at 18:22
  • It's not clear if you're asking how much memory an SSH connection should use or how much memory an instance should use when all it is has is an SSH connection. – David Schwartz Jul 7 '17 at 20:43

Get a better provider than GoDaddy. BlueHost or Hostgator spring to mind, although I've never used either.

Your ps aux output shows that your ssh session is currently using 1.8kib of memory 1.8 SSH 1.6 -bash 124 cpaneld 1.02 ps aux

All sizes are in kib, so total is about 128mb. It's not unreasonable to think that a fully configured and running OS would be using another 300mb and that the panel before you ssh is showing it in some minimal power state and when you ssh in it brings up it's full functionality.

Another thought is that they give you a jailed session and are only allocating resources against your limit when you're logged in or actively running something.

|improve this answer|||||
  • That's interesting about something like a jailed session. I've never thought of that. So you are saying SSHd is not taking up the RAM, but the host is somehow over-allocating it? – Drakes Jan 18 '16 at 18:24
  • Not really, ps aux is probably reporting exactly what it's using. The output you gave, did you filter it by user123 (ps aux | grep user123)? I bet if you don't filter that it'll show the remaining 300ish mb of allocated memory to some system processes – Logan Jan 18 '16 at 18:27
  • That was just straight ps aux with no filtering. I'll update my question to reflect this – Drakes Jan 18 '16 at 18:32
  • I'd like to know what OS is running on that. cat /etc/redhat-release or lsb_release -a – Logan Jan 18 '16 at 18:49
  • "Command not found" and "No such file or directory". Shared Hosting. – Drakes Jan 18 '16 at 18:58

I believe they run some kind of containers so you don't see the whole picture. Your ps aux is really limited.

When there is nothing running, they probably stop the box/swap memory somewhere and report zeros, if you ssh in, they put the box online and load the whole system.

500 MB is too much for one ssh connection. It correlates to whole system.

|improve this answer|||||
  • That makes sense. It doesn't make me happy, but it makes sense logically. – Drakes Jan 18 '16 at 18:35
  • Containers are important technology today. If they say you have VPS, you don't. But it saves them a lot of cycles and beginners might not even notice. Opposite to running full-blown virtualization of whole Linux. But yes, it might suite your needs.if you don't need some special technology. – Jakuje Jan 18 '16 at 18:40

Your Answer

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

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