504 Timeout when accessing site after extended periods of time

I wonder if this post (that never got replies) is related… Ghost blogs fail to load - probably DB connection issues on AWS EC2 + RDS