Problem with application load balance that I cannot solve


We have an application load balancer with one instance but scales to 8. My problem is this. I have three mobile applications that log into the instances with POST and json and one of the applications can no longer log in. It logs into the test server that is not on the load balancer, but on the production server, it gives 502 bad gateway sporadically at first but now all the time. The server is not returning bad data because it works sometimes, it seems to be a problem with the load balancer not forwarding requests to the appropriate url. Can somebody give me a clue where to start dissecting this. I have looked at the code, I have looked at the application, and I have looked at the server, and the problem seems to lay with the load balancer just not cooperating for no reason given. Like I said, the other two applications work fine and they all share similar code. I just. found out about it from apple about the problem with the login and this 502 bad gateway error will not go away. Any help with 502 gateway errors would be appreciated. I have increased the timeout on the server, I have tried rebuild the load balancer which worked yesterday for about four hours then quit. I am at just a loss. Thanks in advance.

1 Answer

First thing you need to do is definitively figure out if it is the ALB, or the instance's response to the ALB causing the 502 errors.

Use Cloud watch metrics.

If data points show under the HTTPCode_ELB_502_Count metric, then your ALB is issue.

If errors show under the HTTPCode_Target_5XX_Count metric, then your target instance is the problem.

From there there is additional troubleshooting you can do . . .

This is a good reference.

profile picture
answered 10 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions