I am copying my Stackoverflow question : https://stackoverflow.com/q/63683206/6344947
I saw that I was getting 503 for my application when I was hitting the API's. When I checked the HAProxy LB stats for my instances, I found that one of them was showing Layer 4 timeout and the other one was showing Layer 7 timeout.
The instances had a Java process running in them which was acting as the backend service. On restarting the process, I found that things were back to normal.
So is there any way to find out what the cause could be? Could it be because of out of memory issues too? I had seen the logs, but there were nothing related to OOM; also, we had OOM issues in that instance in the past - but at that time I didn't check HAProxy stats.
Any help would be appreciated.