- 最新
- 投票最多
- 评论最多
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:
- CDN
- Caching with in-memory database such as elastic-cache to cache db queries.
- Upgrade your instance size
- Load Balancer
- Read only DB offload the read queries
- Increase storage type
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.
相关内容
- AWS 官方已更新 3 年前
In addition to the above: