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 !!
MORE INFO
EC2 type: t3.micro
Application info: Django
with Apache
server, both running inside docker container
using docker-compose
file ..works on port 80
Monitoring results: Mostly before this error CPU
usage had some kind of a spike and it reached about 60%
.. never higher than that
Assets / Uploaded media: I am using the S3
bucket for both static data and uploaded media.
Database: Using the RDS
database service from AWS
Network: Everything runs inside a VPC
NOTES
This app works locally in perfect shape for hours without having this error.