Rachel
Rachel

Reputation: 21

Will increasing my EC2 limit for the relevant instance solve a latency issue?

I'm a noob and am having a problem with one specific instance.

Can anyone tell me if increasing some (?) limit for this instance will solve the problem?

The instance type is t2.small.

Also, a customer has had trouble with the website timing out when attempting to sign-up. I assume that would throw a status 500 error, as referenced below, right.

Thus, does this mean a limit increase of some sort would eliminate the timeout problem with sign up?

Two alarms have been going off repeatedly. Here's more info on the first:

Alarm Details:

Monitored Metric:

This is the second:

Alarm Details:

Upvotes: 0

Views: 360

Answers (2)

John Rotenstein
John Rotenstein

Reputation: 269951

Amazon EC2 T2 instances do have limitations on CPU and Network bandwidth. Basically, the bigger the instance, the more you get!

The price difference is rather small, so by all means increase the instance size for a while and see whether it fixes your issues.

T2 instances are great for bursty workloads, where the instance is sometimes busy and sometimes idle. You can activate T2 Unlimited to avoid the CPU issues. It only costs more if the average CPU is above the normal T2 limits for the instance type.

Upvotes: 1

kichik
kichik

Reputation: 34744

You should start by profiling your code to see why it takes so long. Is it waiting on I/O? Is it waiting on network? Are there too many requests and it just sits in the queue? If it's I/O or network, then increasing the instance size might help. Otherwise, you might be able to solve this by fixing your code. For example, you can move some parts of your code to be executed after the request has been sent back. Or maybe your algorithm is just not as efficient as it could be. It might even be a 3rd party service that's slowing you down, like a database or API.

All that said, it might be easier to just increase the instance size and see if it helps. It'd definitely be a quicker solution. But it's just going to happen again as you get more traffic, so you should profile & optimize your code at some point.

Upvotes: 1

Related Questions