[Django]-What happens during AWS Elastic Beanstalk 504 Gateway Timeout

5👍

A 504 Gateway Timeout means the client trying to access the server doesn’t get a response in a certain amount of time. According to the AWS documentation:

Description: Indicates that the load balancer closed a connection because a request did not complete within the idle timeout period.

Which means, the 504 response you get in your browser (or other client) when trying to access your Django app is generated by the Elastic Load Balancer that’s in front of your actual server after closing the connection. Since your ELB is an external networking tool and has no actual control over your server, it cannot control your code and which processes are running or not. Meaning, the process will keep running until it has to return an HTTP response and it fails because of the closed connection.

Leave a comment