A 504 Gateway Timeout error occurs when one server on the internet (acting as a gateway or proxy) does not receive a timely response from another server further upstream. This article helps you identify the cause of a 504 error on your website and provides steps to resolve it.
Before you begin
You will need:
Access to your website's administrative dashboard (if available) or your hosting control panel.
The ability to identify the specific URL where the error is occurring.
Check the source of the timeout
A 504 error is often caused by a script taking too long to execute, a server being overloaded, or a communication failure between a proxy (like Cloudflare) and your origin server.
Determine if the issue is local or external
Attempt to load the website on different devices and different networks (e.g., switch from Wi-Fi to a mobile data connection).
If the site loads on other networks, the issue may be related to your local network or ISP.
If the site fails on all networks, the issue is with the server or the connection between the proxy and the server.
Check for a proxy or CDN
If you use a service like Cloudflare, a 504 error often means the Cloudflare edge server cannot reach your Hostek server.
Check if the error page is branded by a third party (e.g., Cloudflare).
If it is, the issue is likely a communication failure between the proxy and the origin.
If the error page is generic or branded by your hosting provider, the issue is likely a server-side script timeout or resource exhaustion.
Identify the specific script or plugin
If the error only occurs on a specific page (such as a checkout page or a search results page), the issue is likely a specific script or plugin.
Navigate to the page where the error occurs.
If you use WordPress, try deactivating the most recently installed or updated plugin.
If the page loads correctly after deactivation, that plugin is the cause of the timeout.
Check server resources and limits
If the 504 error occurs across multiple pages or during high traffic, the server may be struggling to process requests.
Log in to your hosting control panel.
Check your resource usage (e.g., CPU, Memory, or Entry Processes).
If resources are at or near 100%, the server may be unable to process requests in a timely manner.
If a specific process is hanging, you may need to restart the service or the server.
Check for a script timeout
A script that takes too long to run will eventually be "timed out" by the server.
Identify if the error occurs during a specific action, such as importing a large file or processing a large batch of data.
If the action is known to be resource-intensive, it may be hitting a
max_execution_timelimit.You can check your current limits in your control panel's PHP settings.
Contact Hostek support
If you have performed the checks above and the site remains inaccessible, the issue may require a server-side adjustment or a restart of a specific service.
To help Hostek support resolve the issue quickly, please provide the following information:
The specific URL(s) where the 504 error occurs.
The time the error first started.
A screenshot of the error page.
Any recent changes made to the site, such as new plugins, theme updates, or changes to your DNS or proxy settings.
