0

I have a MySQL database in AWS RDS. It is an r4.large machine with 16GB ram. I have been testing its load capacity and find out that upto 18 concurrent users, the app works fine. Then we decided to do a soak test on this application. At that time we saw the result or the response time got higher and higher.

Eg: On the first loop, the test completes in 1 minute for 3 APIs. On the 12th loop, I got a Bad Gateway error. On the 20th loop, the response time for a small API increased to nearly 1 minute (On first loop it was 4 seconds).

I'm not sure what makes this performance issue. I'm not an expert in RDS. What do I do to improve the performance or avoid this issue?

Neron Joseph
  • 287
  • 1
  • 5
  • 10

1 Answers1

0

Yep. Have you ever been in a grocery store with too many other people? You can't move your cart down an aisle because there are so many other people trying to do the same thing, or stopping to pick items.

If 18 work fine, but 20 gets bad response time, then try to stop new customers at the door; don't let them crowd the aisles.

Or...

Another common cause (and solution) is slow queries. Find them and fix them. Use the slowlog to help finding them; then show us the queries and SHOW CREATE TABLE. Sometimes you can speed up a query by adding a composite index. The sooner those customers get out of the store, the sooner others can get in. There may still be a limit of 18, but if each is finishing twice as fast, then you have twice the "throughput" without slowing down "latency".

(I am not a fan of benchmarks; they often point in the wrong direction.)

Rick James
  • 2,463
  • 1
  • 6
  • 13