Hello, I've been running a wordpress site very smoothly for the past year or so. But I always have the same problem during traffic spikes (more than say 1k people coming at the site at the same time) It's very hard for the page to load, the server is already configured to take such load, and at first I taught it was a server issue. But a message shows up saying "Wordpress could not connect to database" or a simple "Error establishing database connection" Once again, this only happens during traffic spikes. The WP-Config file is configure just fine with the right user, password , and "localhost" All tips are appreciated as this is very frustrating! Thanks
You could try deleting the themes you do not use out of wp-content/themes and also deleting any inactive plugins. Then, there is page caching. How often do you update?
This happens when your bandwidth bursts out. It means you have consumed your monthly assigned bandwidth.
I recently had the same problem with some of my larger sites a while back. MySQL (your databases) take the most processing power on your server so it is the first to crash. The solution that fixed my problem was getting a RAM upgrade and later I upgraded to a database server to manage only my MySQL databases. I have an i5 with 16GB of RAM on the web server and an i7 with 16GB of RAM on my database server. Database servers are usually better than your web server. Other solutions to reduce your load that are a little bit more affordable are: 1. Using a CDN. Check out MaxCDN.com or Amazon's CloudFront (won't cost you toooooo much compared to what you are already paying for your dedicated server) 2. CloudFlare.com (FREE or $20/month for premium) 3. WP Super Cache (FREE) 4. I have also heard great things about JetPack, it uses WordPress.com's Cloud Hosting with your self-hosted WordPress site. Check out JetPack.me. (FREE) Hope this helped
He is right. You need to upgrade your RAM to solve this issue. Instead of WP Super Cache, I will suggest to use Hyper Cache. But never use W3 Total Cache.
I am the evidence of it. I had used W3 total cache in my VPS to make my WP site faster. But it was consuming heavy RAM in my VPS. So I decided to test it in some other server, and found the same result. It saves site loding time, but it increasing RAM usage. So if you have good number of visitors, you will face problems is shared or low level VPS servers.
If you host with Hostgator then YES i experience the same damn issue as well a LOT!!! That means i do NOT recommend Hostgator (of course!).