Auto scaling is not able to scale enough in a short time

0

I am not an expert in this part of AWS and I have some doubts about what is happening in my app.

My backend application becomes unresponsive for a few seconds/minutes when it receives a sharp spike in requests. Apparently the problem is that it can't scale fast enough. A quick but more expensive solution we have addressed this with is to increase the standby instances.

But... Is there another way to handle sudden spikes in requests? Is this a configuration issue with my load balancer? How can I improve autoscaling?

Thanks in advance

Gabym
asked 8 months ago386 views
2 Answers
1

Depending on your setup, there's multiple ways to address this issue that comes with an increase cost. Take a look cloudwatch metrics to identify the bottle neck in your setup such cpu, network, RTT, load time, etc....

Here's something you can use to address the performance issues:

  1. CDN
  2. Caching with in-memory database such as elastic-cache to cache db queries.
  3. Upgrade your instance size
  4. Load Balancer
  5. Read only DB offload the read queries
  6. Increase storage type
AWS
nael
answered 8 months ago
profile picture
EXPERT
reviewed 8 months ago
  • In addition to the above:

    1. Figure out where the delays are (waiting for alarm; bootstrapping; waiting for instance launch; etc)
    2. Use a Warm Pool on the ASG if there's long bootstrapping time
    3. Set the scale-out threshold less aggressively
    4. If the spikes are predictable; use Scheduled or Predictive Scaling policies
0

There's not enough information in the question to give a definitive answer.

The majority of scaling time is normally in creating the compute that will handle the request(s) that are arriving. So it's important to know whether you're using EC2, ECS, EKS, Lambda, etc. Operating system can also be a factor here. Without that information it's difficult to provide advice.

You have mentioned using a load balancer so the implication is that your back end infrastructure is EC2-based. Here is some general advice:

  • Make your AMI (or container image) as small as possible and bake in as much as possible. That way launch times for new instances will be faster.
  • Adjust your auto-scaling parameters so that you scale sooner rather than later.
  • You may have to keep more instances running at all times in order to deal with spikes in traffic.
  • Finally, you might try using predictive scaling.
profile pictureAWS
EXPERT
answered 8 months ago

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