7

I am running an EC2 Instance on Ubuntu Server machine. Tomcat and MySQL are installed and deployed java web-application on it since 1 month. It was running good with great performance for almost 1 month but now my application is responding very slow. Also, point to note is: Earlier when I used to log into my Ubuntu Server through PuTTY, it was quick but now its taking time even when I enter Ubuntu password.

Is there any solution?

Dmitry S
  • 4,990
  • 2
  • 24
  • 32
Simar
  • 71
  • 1
  • 1
  • 7
  • 1
    What is the EC2 instance class? If it is a t2.*, you need to check your "CPU credit balance," not only now, but historically for comparison, under the "monitoring" tab when you select the instance in the console. – Michael - sqlbot Aug 27 '15 at 11:30

5 Answers5

7

I would start with checking with memory/CPU/network availability to check if it is not bottleneck.

Try following commands:

  • To check memory availability:

    free -m

  • To check CPU usage:

    top

  • To check network usage:

    ntop

  • To check disk usage:

    df -h

  • To check disk io operations:

    iotop

Please also check if when you disable your application you are able to quickly log in to that machine. If login is still slow, then you should contact your EC2 support complaining about poor performance and asking for assigning more resources for that machine.

  • 1
    I checked the memory status, RAM was almost full, so i cleared the buffer and cache memory. Now its running good. Thanks guys for your support. – Simar Aug 31 '15 at 11:35
  • "To check CPU usage:" Some prefer "top -n 1" to run it once and exit from command. – Tonio Liebrand Jan 13 '17 at 11:34
1

You can use WAIT Tool to diagnose what is wrong with your server or your application. The tool will gather all information about CPU and memoru utilization, running threads etc.

0

In addition, I would definitely check Tomcat application server with VisualVM or some other profiler. For configuring JMX for Tomcat you can check article here.

For network monitoring - nload tool is worth your attention. You can launch it in screen so you always check network utilization stats when server is slown.

Community
  • 1
  • 1
Dmitry S
  • 4,990
  • 2
  • 24
  • 32
0

First check is there any application using too much cpu or memory. This can be checked by using top command. I'll tell you two simple shortcut keys that may be helpful while using top command. In top command result page, if you enter M it will sort application based on memory usage, from highest to lowest. If you enter P it will sort application based on cpu usage, from highest to lowest.

If you are unable to find any suspicious application using top you can use iotop it will show disk I/O usage details.

Fathah Rehman P
  • 8,401
  • 4
  • 40
  • 42
0

I was facing the same issue, the solution which worked for me was

Restart the ec2 instance

Edit

lately, I figure out this issue is happening due to the fewer resources (memory, CPU) available to the EC2 machine. So check available resources to the EC2 machine.

bSr
  • 1,410
  • 3
  • 16
  • 30