For starters, “Error establishing a database connection” could be anything. Please enable WP_DEBUG mode to see the actual database error message:
I don’t think the database is going down, I think it’s more likely that you’re hitting the database connection limit.
But I don’t know anything for sure. If you want to know for sure, you’ll need to obtain the actual connection error message.