{"id":36940,"date":"2024-12-10T06:23:49","date_gmt":"2024-12-10T06:23:49","guid":{"rendered":"https:\/\/www.wpstaq.com\/?post_type=knowledgebase&#038;p=36940"},"modified":"2024-12-10T06:23:49","modified_gmt":"2024-12-10T06:23:49","slug":"504-gateway-time-out-error","status":"publish","type":"knowledgebase","link":"https:\/\/www.wpstaq.com\/sg\/knowledgebase\/504-gateway-time-out-error\/","title":{"rendered":"504 Gateway Time-out error"},"content":{"rendered":"<p>A <strong>504 Gateway Time-out error<\/strong> typically occurs when your website&#8217;s PHP workers are overwhelmed and unable to process requests. Each hosting plan on Staq is assigned 10 PHP workers by default, which is usually sufficient for most websites. However, certain plugins or configurations can cause PHP workers to hit their maximum capacity, resulting in this error.<\/p>\n<h2>PHP Workers Assessment<\/h2>\n<p>To assess how many PHP Workers a particular site has, in Staq Panel, under Advanced, click <strong>PHP Config<\/strong> and you&#8217;ll see the value under\u00a0<strong>Max PHP Workers<\/strong>.<\/p>\n<p>In order to see if PHP Workers have hit their limits, go to the site&#8217;s Staq Panel and under Metrics, click\u00a0<strong>PHP Workers<\/strong>. Then select Hourly &gt; 3 followed by <strong>Parallel PHP Workers<\/strong>:<\/p>\n<p>If the site&#8217;s default is 10, in the graph below, you can see that it&#8217;s hitting its limit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36942\" src=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png\" alt=\"\" width=\"1233\" height=\"770\" srcset=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png 1233w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit-300x187.png 300w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit-1024x639.png 1024w, https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit-768x480.png 768w\" sizes=\"auto, (max-width: 1233px) 100vw, 1233px\" \/><\/p>\n<h2>Common Causes<\/h2>\n<p>The common causes of a site hitting maximum PHP Workers are listed below but not limited to:<\/p>\n<ul>\n<li>Preloading cache pages from performance plugins such as Nitropack, WP Rocket and BerqWP<\/li>\n<li>Search engines or bots from Facebook randomly visiting uncached pages which fills up the PHP-FPM pool<\/li>\n<li>Trusted bots (listed as trusted bots on the Staq infrastructure) continues to bombard the site with requests.<\/li>\n<\/ul>\n<h2>Resolving the 504 Error<\/h2>\n<p>To address this issue, follow these steps:<\/p>\n<h3>Optimize Your Plugins<\/h3>\n<ul>\n<li>Review and configure your caching plugins carefully. Disable or adjust the preloading features to reduce their impact on server resources.<\/li>\n<li>If preloading is unnecessary, consider disabling it to alleviate the load on PHP workers.<\/li>\n<\/ul>\n<h3>Enable Staq Cache<\/h3>\n<ul>\n<li>Staq Cache is a highly efficient caching solution integrated with Staq Hosting.<\/li>\n<li>It improves website performance by reducing the load on PHP workers.<\/li>\n<li>Once enabled, preload the cache carefully to avoid overloading PHP workers.<\/li>\n<\/ul>\n<h3>Scale Up PHP Workers<\/h3>\n<ul>\n<li>If your website consistently exceeds the default limit of 10 PHP workers, consider scaling up.<\/li>\n<li>Refer to this guide for instructions: <a href=\"https:\/\/www.wpstaq.com\/knowledgebase\/how-to-increase-php-workers\/\" target=\"_blank\" rel=\"noopener\">How to Increase PHP Workers<\/a>.<\/li>\n<\/ul>\n<h3>Ban particular requests from trusted bots like Facebook<\/h3>\n<p>If there&#8217;s no reason for a bot like Facebook or Apple to crawl a site, you can simply disable their access using Staq Firewall by following this <a href=\"https:\/\/www.wpstaq.com\/knowledgebase\/how-to-ban-an-ip-address-using-staq-firewall\/\" target=\"_blank\" rel=\"noopener\">guide<\/a>.<\/p>\n<h2>Preloading the Cache<\/h2>\n<p>While preloading the cache is a useful feature, it should be configured judiciously. Overuse can lead to excessive PHP worker usage. Always monitor server performance while preloading is enabled.<\/p>\n<p>Alternatively, you can enable Staq Cache which has a more efficient preloader function.<\/p>\n<h2>Conclusion<\/h2>\n<p>A 504 Gateway Time-out error is a sign that your website\u2019s PHP workers are under stress. By optimizing plugins, enabling Staq Cache, and scaling up PHP workers if needed, you can resolve this issue effectively and ensure your website runs smoothly.<\/p>\n<p>If you encounter further issues or require assistance, don\u2019t hesitate to reach out to our support team.<\/p>\n","protected":false},"featured_media":0,"parent":0,"template":"","class_list":["post-36940","knowledgebase","type-knowledgebase","status-publish","hentry","categories-server-errors"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>504 Gateway Time-out error - Managed Hosting Platform for WordPress<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"504 Gateway Time-out error - Managed Hosting Platform for WordPress\" \/>\n<meta property=\"og:description\" content=\"A 504 Gateway Time-out error typically occurs when your website&#8217;s PHP workers are overwhelmed and unable to process requests. Each hosting plan on Staq is assigned 10 PHP workers by default, which is usually sufficient for most websites. However, certain plugins or configurations can cause PHP workers to hit their maximum capacity, resulting in this&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Managed Hosting Platform for WordPress\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/staqhosting\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/\",\"name\":\"504 Gateway Time-out error - Managed Hosting Platform for WordPress\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/php-workers-limit.png\",\"datePublished\":\"2024-12-10T06:23:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/#breadcrumb\"},\"inLanguage\":\"en-sg\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-sg\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/php-workers-limit.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/php-workers-limit.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/504-gateway-time-out-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.wpstaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"504 Gateway Time-out error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"name\":\"Managed Hosting Platform for WordPress\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wpstaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-sg\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\",\"name\":\"Staq\",\"alternateName\":\"WPStaq\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-sg\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"width\":512,\"height\":512,\"caption\":\"Staq\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/staqhosting\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpstaq\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"504 Gateway Time-out error - Managed Hosting Platform for WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/","og_locale":"en_US","og_type":"article","og_title":"504 Gateway Time-out error - Managed Hosting Platform for WordPress","og_description":"A 504 Gateway Time-out error typically occurs when your website&#8217;s PHP workers are overwhelmed and unable to process requests. Each hosting plan on Staq is assigned 10 PHP workers by default, which is usually sufficient for most websites. However, certain plugins or configurations can cause PHP workers to hit their maximum capacity, resulting in this&hellip;","og_url":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/","og_site_name":"Managed Hosting Platform for WordPress","article_publisher":"https:\/\/www.facebook.com\/staqhosting\/","og_image":[{"url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/","url":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/","name":"504 Gateway Time-out error - Managed Hosting Platform for WordPress","isPartOf":{"@id":"https:\/\/www.wpstaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/#primaryimage"},"image":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png","datePublished":"2024-12-10T06:23:49+00:00","breadcrumb":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/#breadcrumb"},"inLanguage":"en-sg","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-sg","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/#primaryimage","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2024\/12\/php-workers-limit.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/504-gateway-time-out-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wpstaq.com\/"},{"@type":"ListItem","position":2,"name":"504 Gateway Time-out error"}]},{"@type":"WebSite","@id":"https:\/\/www.wpstaq.com\/#website","url":"https:\/\/www.wpstaq.com\/","name":"Managed Hosting Platform for WordPress","description":"","publisher":{"@id":"https:\/\/www.wpstaq.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wpstaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-sg"},{"@type":"Organization","@id":"https:\/\/www.wpstaq.com\/#organization","name":"Staq","alternateName":"WPStaq","url":"https:\/\/www.wpstaq.com\/","logo":{"@type":"ImageObject","inLanguage":"en-sg","@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","width":512,"height":512,"caption":"Staq"},"image":{"@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/staqhosting\/","https:\/\/www.linkedin.com\/company\/wpstaq"]}]}},"_links":{"self":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/knowledgebase\/36940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/types\/knowledgebase"}],"wp:attachment":[{"href":"https:\/\/www.wpstaq.com\/sg\/wp-json\/wp\/v2\/media?parent=36940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}