A bit more than 24 hours ago, my WordPress site, which has been happily running on the NewsMag theme for a few months, stopped responding, giving me a “Error Establishing a Database Connection” error instead of my content. I had updated to NewsMag 4.3 a couple of weeks ago, but there were no other changes the preceded this problem. Upon further investigation, my database connection became unusable because WordPress initiated a huge number of connections with the database and didn’t shut them down afterwards. Upon looking at those MySQL processes, the ones that stuck around were SLEEP processes–they did appear to be long queries, or anything like that.
In an effort to solve the problem, I disabled plugins, and that did not help. NewsMag 4.4 was released today, so I tried updating to that. That did not help. I tried using a larger database, and WordPress simply consumed whatever number of connections I gave it, yielding the “Error Establishing a Database Connection” error. So using a dedicated database with 16 GB RAM was not enough to handle the connections.
Finally, when I switched from NewsMag to the “2015” theme that comes with WordPress, my problems went away. With the same load, the database now handles only a few requests from WordPress rather than having 40+ of them killing my database connectivity. Whatever the problem is, it seems to be associated with the theme not playing nicely with something in my environment.
I run nginx 1.10.3 on ubuntu with PHP 7.0.30 and php-fpm. As noted the system was working fine until around 19:00 UTC on May 23, 2018. I use WordPress 4.9.6.
Does NewsMag support have any idea what in the theme could cause generation of lots of MySQL SLEEP queries that do not go away on their own? How can I stop this?
Hi,
So by having the theme and only theme plugins active, the error begins to appear. While before there was no problem running the website. Basically the theme requirements are these
– https://forum.tagdiv.com/newsmag-requirements-for-newsmag/
The theme and theme plugins would function correctly in those circumstances.
I found these guides you can follow to try and debug this problem, there are more
– https://websitesetup.org/error-establishing-a-database-connection/
– https://www.wpkube.com/how-to-fix-error-establishing-database-connection-in-wordpress/
– https://www.digitalocean.com/community/tutorials/how-to-debug-the-wordpress-error-establishing-database-connection
Let us know what you find.
Can you address whether there is something in the theme that could cause these MySQL SLEEP requests to be sent? It does not happen when using the built-in Twentyfifteen theme, so something is different when NewsMag is in-use.
Although I deactivated several plug-ins during my troubleshooting, I did not try turning off all plug-ins except for the tagDivones. I understand why you are asking this, but my site will break in other ways without plug-ins, so this is not a useful test for me.
Also, this is a separate concern, but is the tagDiv Composer plug-in required for the theme, even if I do not plan to use tagDiv Composer. It seems like a complex plug-in, and I would prefer to leave it deactivated.
It is supposed to be different then a default WordPress theme. A premium theme contains different code and functionality than a default one.
You can use the other page builder provided in the package (WPBakery page builder), if you do now want to use the tagDiv composer
– https://forum.tagdiv.com/newsmag-how-to-use-visual-composer/
Deactivating plugins would be the first set to take when there are problems. This way one can begin looking elsewhere for the problem, by eliminating plugins as the cause.
Something must have happened before the issue began, maybe a plugin has auto-updated. If there were no problems before, that could be a plausible thing to check.