I am using AWS and my backend code is written in Java Spring and Hibernate. Sometimes the API is responding within a second but sometimes it takes a long time. I have seen ELB logs and the requests and response is not taking the time but sometime the backend is taking time to calculate the response. So why is this happening? Is it due to large number of connections? If so only 3 connections are there with the db then also it is taking a lot of time in sending the response. So can anybody let me know why this is happening?
Thanks & regards.