Yesterday my Amazon Web Service instance was running perfectly but today morning it became slow. I searched on internet about it and found that I can reboot my Amazon Web Service instance to increase performance so I rebooted my instance.

But from that time it became even more slower and sometime not even able to access it, If I restart my mysqld it starts working but again even a simple query takes lot of time. I am using Amazon Web Service free Tier EC2. Is there something I missed after rebooting?

closed as unclear what you're asking by Tim, kasperd, Jenny D, ThoriumBR, Dave M Nov 12 '17 at 13:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    You probably have run out of CPU Credit – Sathyajith Bhat Nov 5 '17 at 16:03
  • Actually i have checked my CPU credits, Instance is using only around 20% of CPU. @Sathya – Manoj ahirwar Nov 5 '17 at 16:53
  • CPU credits is different from CPU usage. Read this. If you want help you're going to have to share information such as instance type, top screenshot, and a screenshot of your CloudWatch dashboard showing CPU usage and CPU credit balance, what the server does, etc. Another thing to do is stop then start the server, which moves you to new hardware - a restart doesn't. From memory a stop / start cycle gives you a new CPU credit balance, but you have to pay for a new hour. – Tim Nov 5 '17 at 18:28

There are a number of factors that can cause an EC2 instance (or any system) to appear to run slowly.

  1. CPU Usage. The higher the CPU usage the longer to process new threads and processes.

  2. Free Memory. Your system needs free memory to process threads, create new processes, etc. How much free memory do you have?

  3. Free Disk Space. Operating systems tend to thrash when the file systems on system drives run low on free disk space. How much free disk space do you have?

  4. Network Bandwidth. What is the average bytes in / out for your instance?

When I see a slow EC2 instance, I temporarily bump it up an instance size or two. Then I remeasure. If I see a good increase in performance, then I am pretty sure that the instance is overloaded. Next I try to determine which factor of CPU, Memory, etc. is the culprit.

Amazon has CloudWatch which can provide you with monitoring for everything except for free disk space (you can add an agent to your instance for this metric). This will also help me quickly see what is happening with my instances.

In general I find that a web server and MySQL on a T2.nano or T2.micro is not that good unless there is very little network traffic.

If your average CPU utilization is 20%, then a t2.micro would be too small. A t2.small has enough CPU credits so that the CPU utilization can be 20%.

For example, a t2.small instance receives credits continuously at a rate of 12 CPU Credits per hour. This capability provides baseline performance equivalent to 20% of a CPU core. If at any moment the instance does not need the credits it receives, it stores them in its CPU Credit balance for up to 24 hours. If and when your t2.small needs to burst to more than 20% of a core, it draws from its CPU Credit balance to handle this surge seamlessly. Over time, if you find your workload needs more CPU Credits than you have, or your instance does not maintain a positive CPU Credit balance, we recommend either a larger T2 size, such as the t2.medium, or a Fixed Performance Instance type.

Burstable Performance Instances

  • I run a t2.nano as a web server for Wordpress, including MySQL. Because things are so heavily cached on the CDN the average CPU usage is around 2%. It works very well. – Tim Nov 5 '17 at 18:30
  • @Tim. Good example of the benefits of CDNs such as CloudFront. – John Hanley Nov 5 '17 at 18:42

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