One of our sites keeps going offline and I'm running out of ideas. It's a wordpress site built with the Avada theme and it's goal is to server as a calendar of events using The Events Calendar plugin.

It runs on Ubuntu 16.04 with nginx hosted with Amazon. I've tried a lot of things to improve mysql performance as I think it is the heart of the issue but I cannot be sure. php_log is empty there is some things coming into debug.log however these mostly relate to the database being inaccessible.

The first day the issue appeared (Tuesday) I was able to continue getting into wordpress by restarting mysql from PuTTY. That does not seem to be working anymore. We thought it was due to the number of events in our database (6000+) so I purged everything from wp_posts table that was created prior to 2017.

We get brief moments where the site works, sometimes for up to an hour and then it is taken offline again. I have run linux malware detection on the server and it came up empty handed. I think the issue stems from a plugin most likely the-events-calendar as it is the biggest thing we use but I can't be sure.

Website URL: http://calendar.childmags.com.au/

Edit: It is not a plugin as disabling did not fix the issue. Something is up with the database. nginx error and access logs had nothing substantial in them.

  • downvoted as there is no way anyone might have an answer which is not a pure guess. Most likely your server do no have enough memory, but it might be also a badly configure webserver – Mark Kaplun Feb 13 '18 at 11:32

If you think a plugin is causing the problem, disable all plugins by renaming the wp-content/plugins folder. Then put the plugins (in the subfolders of wp-content/plugins) back into a new wp-content/plugins folder.

Do a couple/three at a time to see if you can find a bad plugin.

You might also reload WP 4.7.2 via the sites Updates page (even if you are already at 4.7.2). If you were not at 4.7.2 (insert standard 'do your updates!' advice here), then you have some additional work....get up to 4.7.2 first, then ensure all plugins are current.

5xx errors are often server-based, not WP-based (although could be SQL problems), so talk to your host and ask if they are noticing SQL problems on your (possible shared) server.

Updates are important....there are tons of WP sites that are getting hacked via the RESTFUL problem fixed by 4.7.2.

  • We are fully up to date, I have disabled all the plugins and still having issues so maybe it is a corrupted database. I have placed a ticket with amazon support to see if they can do anything about it. – benikens Feb 9 '17 at 2:01

In WordPress specifically, 504: Gateway Timeout messages are sometimes due to corrupted databases. Install plugin such as WP-DBManager and then try the "Repair DB" feature, followed by "Optimize DB" and see if that helps.

php_log is empty because more often than not that 502 and 504 are caused between servers than by the application, nginx error log or access log, or database log might provided more clue than php_log. Restart all your servers and devices, check your proxy setting (I noticed your server is using CloudFlare as cacheing), and also try to change your DNS to see if it is help. Also try curl -I internalIP to see what you would get compare to `curl -I calendar.childmags.com.au'. Based on limited information that you provided, this is what I could think of.

  • The first curl returned a bad gateway 502 the second one gave me Gateway time-out. I've run mysqlcheck -o --all-databases from PuTTY is that similar to the WP-DBManager? I will try and run it, proving difficult atm to get into the back end. – benikens Feb 9 '17 at 1:54
  • Yes, you could run mysqlcheck -u root -p --auto-repair --check --optimize --all-databases to do all at once. Back up first. – hcheung Feb 9 '17 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.