When issues occur in the request-response cycle, the Avi Load Balancer responds with error codes based on the nature of the error. Error codes make it easier to pinpoint the exact problem and where it occurs, thereby enabling quicker error resolution or corrective action.
4xx or 5xx error codes
HTTP response code 4xx: If errors occur in client requests, the Avi Load Balancer responds with an HTTP response code 4xx.
HTTP response code 5xx: If there is a load balancing failure or error communicating with the server, the Avi Load Balancer responds with HTTP response codes 502, 503, 504, and so on. If there are internal errors on the Avi Load Balancer (for example, memory allocation failure or DataScript exception), the controller responds with an HTTP response code 500.
HTTP 504 Error Code
The Avi Load Balancer responds with an HTTP 504 error code when it can send the request to the back-end server (that is up and running at that point), but the back-end server goes down just before it can respond. By default, the Avi Load Balancer waits for a response till the read_timeout (which is by default 1 hour), at the end of which it responds to the client with an HTTP 504 response code. The reason behind the long default timeout values for the back-end server is that the client would close out, or the application might close out the connections in the case of an error.