Error Establishing Database Connection

May 17, 2016 354 views
MySQL WordPress

My Website Is Frequently Going Down When I Get High Traffic,It Give error establishing database connection...when i restart web server and droplet it is working back...i would like to know why is it going down,what should i do to solve this problem? iam using apache web server 80$ Digital Ocean Plan And Cloudflare Of Free Service

My Web Site Gets 50K-90K Page Views Daily...Plz Help me Solve This Issue

2 Answers

"Error establishing database connection" in WordPress can often result from your server running out of memory and having to kill MySQL. If you see it happening when your server is getting a lot of traffic, you should try using caching plugins such as WP Super Cache or WP Rocket configured to cache pages as static files.

The problem is likely only that your site's PHP code can't handle the volume of requests it's getting with your particular server hardware and configuration. So, a great solution is to keep requests from hitting PHP at all by using WordPress caching plugins.

Stop being a cheapskate and hire a proper sysadmin, with 50-90k page views a day that should not be much of an issue :)

Have another answer? Share your knowledge.