Linux – Amazon EC2 instance – issuing “top” command just goes blank on the ssh terminal

amazon ec2command-line-interfacedebugginglinux

I have created an Amazon EC2 micro instance, running Amazon AMI. I logged into the server using ssh client. Once it logs in successfully, if I issue the "top" command, the top output never shows up and the command never returns. It constantly waits. I have to kill the ssh session and re-login. Of course none of the other things like java, tomcat etc., are working.

I rebooted the server, same problem persists. I finally changed the instance to "small" instance, even there I am facing the same problem.

During some times of the day, it seems to work fine without the above problems.

Anybody has any ideas on why this happens? Is this related to the CPU stealing or thrashing?

SOLVED: "To avoid potential problems with MTU settings and packet loss, also add a rule to allow "All ICMP". After you create the new rule, click Apply Rule Changes." Got the solution from this link- http://code.google.com/p/opendatakit/wiki/AggregateAWSInstall

Best Answer

I suspect MTU problems whenever I get a suspicious network hang like this. Try cating a large text file (something over 4k), and see if that hangs the session, too. If it does, it's almost certain that you've got a small MTU somewhere along the path that's causing you issues (especially since it's time-of-day dependent; perhaps your traffic's taking a different route at different times of the day). Google around (or ask a new question) to work out how to fix MTU problems (I'm not going to spend long writing it all out here, on the off-chance I'm wrong).