dpruth dpruth - 1 month ago 14
PHP Question

Persistent 504 Timeouts with WooCommerce

I am consistently getting 504 "Gateway Timeout" errors when trying to update posts, settings, or other data in Wordpress. This is on a shared NetworkSolutions host, and Network Solutions support told me:


These errors occur when the SSL Proxy tier "Times out" waiting for code on your hosting package to execute or load. Our SSL Proxy admins are not able to raise the timeout settings on the proxy server without negatively impacting performance globally. The only solutions are to not use an SSL on your site, or to optimize your code. If your code is able to complete loading server-side and be delivered to a client machine in under 30 seconds, the timeouts will not occur on your site(s). For example, your site has 30 .CSS files and 38 .JS files. There should be less than 10 of each on an optimized site, and having more will increase the chance of the SSL proxy timing out waiting for these to be called, downloaded, and rendered.


I have already attempted to set
max_execution_time = 1600
and
memory_limit = 128M
in php.ini. And it doesn't seem to matter if I force https in the Wordpress Admin, or just use http.

We have a fairly complex Wordpress install (see the list of plugins below), with our own custom post types in addition to WooCommerce. And we are using a Storefront child theme.

My Questions:




  • Is there a good way to figure out what exactly is causing the timeout?

  • Would simplifying my theme (essentially building our own parent theme, rather than modifying Storefront via a Child theme) improve performance at all?

  • Do I really just need to explore alternative hosting environments?



--

Here are additional system details from WooCommerce:

WC Version: 2.6.3
WP Version: 4.5.3
WP Memory Limit: 256 MB


Server Info: Apache



PHP Version: 7.0.2-pl0-gentoo
PHP Post Max Size: 50 MB
PHP Time Limit: 1600
PHP Max Input Vars: 1000
cURL Version: 7.39.0
OpenSSL/1.0.1r

Max Upload Size: 50 MB
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔


Database



WC Database Version: 2.6.3
woocommerce_sessions: ✔
woocommerce_api_keys: ✔
woocommerce_attribute_taxonomies: ✔
woocommerce_downloadable_product_permissions: ✔
woocommerce_order_items: ✔
woocommerce_order_itemmeta: ✔
woocommerce_tax_rates: ✔
woocommerce_tax_rate_locations: ✔
woocommerce_shipping_zones: ✔
woocommerce_shipping_zone_locations: ✔
woocommerce_shipping_zone_methods: ✔
woocommerce_payment_tokens: ✔
woocommerce_payment_tokenmeta: ✔
MaxMind GeoIP Database: ✔


Active Plugins (31)




  • Advanced Custom Fields Pro: by elliot condon – 5.2.7

  • Akismet: by Automattic – 3.1.11

  • Breadcrumb NavXT: by John Havlik – 5.4.0

  • Contact Form 7: by Takayuki Miyoshi – 4.4.2

  • Disqus Comment System: by Disqus – 2.85

  • Enable Media Replace: by Måns Jonasson – 3.0.4

  • Enhanced Media Library: by wpUXsolutions – 2.3

  • Google XML Sitemaps: by Arne Brachhold – 4.0.8

  • Members: by Justin Tadlock – 1.1.2

  • Menu Exporter: by Joe Hoyle - Human Made Limited – 1

  • PDF Image Generator: by Mizuho Ogino – 1.4.6.5

  • Public Post Preview: by Dominik Schilling – 2.5.0

  • Redirection: by John Godley – 2.4.5

  • Optimize Database after Deleting Revisions: by CAGE Web Design | Rolf van Gelder Eindhoven The Netherlands – 4.1.10

  • Say What?: by Lee Willis – 1.7.1

  • W3 Total Cache: by Frederick Townes – 0.9.4.1

  • WooCommerce Authorize.net Reporting: by WooThemes / SkyVerge – 1.5.0

  • WooCommerce Checkout Field Editor: by WooThemes – 1.4.10

  • WooCommerce Customer/Order CSV Export: by WooThemes / SkyVerge – 3.12.1

  • WooCommerce Authorize.net CIM Gateway: by WooThemes / SkyVerge – 2.3.0

  • WooCommerce Google Analytics Integration: by WooThemes – 1.4.0

  • WooCommerce MailChimp Integration: by WooThemes – 1.0.0

  • WooCommerce Name Your Price: by Kathy Darling – 2.3.4

  • WooCommerce Product Add-ons: by WooThemes – 2.7.21

  • WooCommerce Sequential Order Numbers Pro: by WooThemes / SkyVerge – 1.10.0

  • WooCommerce Social Login: by WooThemes / SkyVerge – 1.8.0

  • WooCommerce: by WooThemes – 2.6.3

  • WooThemes Helper: by WooThemes – 1.6.2

  • WP User Avatar: by flippercode – 2.0.7

  • wpMandrill: by Mandrill – 1.33


Answer

I'll add more details as I have them, but I believe I found the answer.

I had "Object Caching" enabled in W3 Total Cache. However, due to a hosting on a shared server, it appears that this caused more problems than it helped.

I turned off this option, and haven't had a 504 Timeout error since!

Comments