SSH drops or hangs on a T3A instance

0

I have a small dev vm running Debain11. I use remote-ssh with VSCode to connect. Very often my connection gets dropped/unresponsive. When connecting using SSH and the -v flag I can see that the actual connection does occur, but the server doesn't respond with the protocol response.

After about 6 minutes it does connect, but with extreme lag < 10000 ms. Restarting the server solves it for a bit. No demanding software is running and running uptime shows load average: 0.00, 0.00, 0.00.

port 22 is opened and no other security groups are set. The VM does not have an internal firewall set. All IP's are allowed. The key is correct and connects fine after VM stop and start.

Update: Software running Postgresql 13 with one small dev database that is only being hit manually by me. pgAdmin4 - only on localhost and only used by two users.

Metrics like CPU and RAM and Disk IO are all normal.

What else can I check?

yoel
asked 10 months ago194 views
1 Answer
0

The fact that you can SSH to the instance when it first starts shows that your security groups, routing tables, keys etc. are likely all correct. but then a short while later (are we talking hours or days?) you can no longer connect.

You say that the instance isn't running any demanding software, so what exactly are you running on it? You may be running something that is fine at the start, but slowly consumes more and more resources until you can't login any more (it will still show up as running and 2/2 checks passed in AWS Console as it's still actually running, though unusable). Select the instance in AWS Console and look in the Monitoring tab, is there anything of concern in the graphs in here?

profile picture
EXPERT
Steve_M
answered 10 months ago
  • No. CPU and Disk IO are all well below threshold and usually less than 3% usage. Nothing is running on it beyond 'pgadmin4' and postgres. Since this is a dev machine and these packages are configured to only be reachable from local host they are not the issue. The database has one table with maybe ten rows.

  • To augment the metrics in the EC2 section of the AWS Console (which aren't all that great) you could setup CloudWatch agent to collect more detail https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html

    For more detail on the what's being used on the OS side something like sar would be helpful https://wiki.debian.org/sysstat

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions