Error establishing a database connection or Service Temporarily Unavailable

I’m randomly getting “Error establishing a database connection” or “Service Unavailable” errors on my site.

This started with the site being down after a peak n Entry Processes that was visible on cPanel. After following some steps on chat, the site was back again, but if the current theme is active on it the front-end is not working at all. If enabling a default theme like Twenty Fifteen, the front-end loads fine.