I want to benchmark and scale an application that’s hosted on AWS Elastic Beanstalk for optimal performance, scalability, and continual availability.
Resolution
AWS Elastic Beanstalk provisions resources such as Auto Scaling groups, load balancers, and Amazon Elastic Compute Cloud (Amazon EC2) instances. When you benchmark your applications, they remain continually available.
To optimally benchmark and scale your Elastic Beanstalk environment, update the scaling triggers metric of your auto scaling configuration based on your application's behavior. The following are the most common metrics for benchmarking and scaling your application:
- NetworkOut- This is the default metric. Use this metric to scale your application based on the traffic flow from an instance.
- CPUUtilization- Use this metric to scale your application based on its sensitivity to an instance's CPU utilization.
- RequestCount- This metric tracks the number of client requests that hit the application. Use this metric to scale your application based on its sensitivity to the number of requests.
- TargetResponseTime- This metric tracks your application's response time. Use this metric to scale your application based on its sensitivity to response time.
For more information on how to update your scaling triggers, see Configuring Auto Scaling triggers.
To evaluate performance, use a load test tool to configure and simulate a load test.
Important:
- Instance types define your application's ability to handle a load. Each instance type has a defined CPU, memory, network, and disk. Make sure that you choose the right instance type and the total number of instances (minimum and maximum). For more information, see The Amazon EC2 instances for your Elastic Beanstalk environment and Amazon EBS volume types.
- For increased performance, optimize your application's external dependency, such as database connectivity, authentication, and caching.
- Understand the type of load balancer and load balancing algorithm that's used. For more information, see How Elastic Load Balancing works and see the Pre-Warming the Load Balancer section in Best practices in evaluating Elastic Load Balancing.
- Understand the type of protocol that's used. For example, HTTP is faster than HTTPS. However unlike HTTP, HTTPS has an additional step for the SSL handshake.
- Use a suitable performance tuning to accommodate the load. For NGINX, see Tuning NGINX for performance on the NGINX website. For Apache, see Apache performance tuning on the Apache website.