AWS EC2 instance 504 Gateway time-out every few minutes
I am using 2 EC2
from AWS
and a load balancer
to handle traffic .. both EC2
instances are copies of each other with the same app installed. finally, I have a domain connected to a load balancer that opens the app .. and everything works fine for a while then suddenly it starts to be super slow .. also if I connect to one of the instances using SSH
I disconnect and fail to connect again ..also the website gives gateway time out error 504
it stays like that for a few minutes then it starts to work again .. or it works immediately if I reboot both instances !!
Instance is in the EC2 Availability Zone for which the load balancer is not configured to route traffic to
Earlier I created two instances of my microserice running on EC2 in us-east-1c AZ & created a classic load balancer in the same AZ – that worked smoothly.