Search code examples
amazon-web-servicesautoscalingamazon-cloudwatchelastic-load-balancer

Issues while testing on AWS Auto Scaling, ELB, Cloud Watch


I created a Web App in JSP. One of my web app URL is to return a unique ID.

Here it is the URL. www.biomobilestrokelab.com/GateKeeper/newUserId.jsp

It works fine in web browser. Now i want to test scalablity on this Web App. I use Apache Jmeter for this purpose. But when i hit 1000 requests per second then

  • Sometimes all requests return response successfully
  • Sometimes i receive HTTP 504 Gateway Timeout code
  • Somtimes i receive HTTP 503 service unavailable back-end server is at capacity.

I am using AWS Autoscalig with

  1. Minimum instances = 2
  2. Maximum instance = 12
  3. Health check grace period = 300 sec
  4. Default Cool Down = 60 sec

For ELB follwing options are configured.

  1. Time out = 60 sec
  2. Interval = 200 sec
  3. Unhealthy threshold = 2
  4. Healthy threshold = 10

And I apply the following Cloud Watch Matrices for auto scaling.

  1. CPU Utilization: which add 1 instance when it is greater than 10% and remove 1 instance when it is less than 3% and i applied average statistics for period of 1 minute.

  2. Request Count: which adds 1 instance when Sum is greater than 1000 and decrease 1 instance when Sum is less than equal to 1000.

Kindly guide me how can i resolve this issue so that i can successfully hit 1000 or more than 1000 requests per second.


Solution

  • I suggest you either reduce the number of requests per second for a fixed number of instances (to let's say two) or increase the number of instances until there is no error and all the thousand requests per second are handled successfully. Then based on this, you can set the min in your auto scaling group and adjust the CloudWatch alarm.