Home › Knowledgebase › KB-1307

Why is my website showing a 504 gateway timeout error?

Summary

This guide helps you troubleshoot and resolve: Why is my website showing a 504 gateway timeout error?. Follow the steps below to fix the issue.

Quick Tip: Need immediate assistance? 💻 Open a Ticket

Common Causes

A 504 Gateway Timeout error occurs when a server acting as a gateway or proxy does not receive a timely response from an upstream server. Essentially, the server your browser is connecting to is waiting for another server to complete a task, but that task takes too long to finish. This results in the connection timing out and the error page being displayed to the visitor.

Quick Fix Steps

  1. Refresh your browser page by pressing F5 or Ctrl + R on Windows, or Command + R on macOS.
  2. Wait a few minutes and try accessing the website again. Temporary network interruptions often resolve themselves.
  3. Clear your browser cache to ensure you are not loading a cached error page.
  4. Try accessing the website from a different device or network to rule out local connectivity issues.

Detailed Instructions

Check for Resource-Heavy Scripts

If your website runs complex scripts or large database queries, the upstream server may exceed the allowed execution time.

  1. Log in to your website's administration dashboard (for example, the WordPress admin panel).
  2. Review any recently installed plugins or modules and deactivate those that are not essential.
  3. Check your scheduled tasks or cron jobs to ensure multiple heavy processes are not running simultaneously.
  4. Optimise your database tables to remove overhead and improve query response times.

Review Server Resource Usage

Shared or underpowered hosting environments often have strict memory and processing caps. When these limits are reached, the server may stop responding to the gateway.

  1. Log in to your hosting control panel provided by your registrar or hosting provider.
  2. Navigate to the resource usage or statistics section.
  3. Check CPU, memory, and entry process limits to see if any are consistently maxed out.
  4. If resources are frequently at capacity, consider upgrading your hosting plan to accommodate your traffic and application needs.

Investigate Upstream Server Connectivity

A 504 error often points to a breakdown in communication between your web server and a backend service, such as a database server or API.

  1. Verify that your database service is running and accessible from your web server.
  2. Check your firewall settings to ensure the web server can communicate with upstream servers on the required ports.
  3. Review server error logs for messages indicating connection refusals or timeouts to upstream services.
  4. If you use a Content Delivery Network (CDN), check the CDN provider's status page for regional outages affecting Australian traffic.

Troubleshooting

Client-Side vs Server-Side Timeouts

Understanding where the timeout occurs helps determine the correct course of action.

Geographical Latency

If your website's servers are located overseas, Australian visitors may experience higher latency. While this usually causes slow loading rather than a 504 error, extremely long response times can contribute to gateway timeouts when combined with resource-heavy operations.

Note: Monitoring your website during peak traffic periods can help you identify if timeouts occur only when resource demand is highest.

Warning: Avoid making changes to core server configuration files such as .htaccess or nginx.conf unless you are familiar with the syntax, as incorrect edits can take your website offline entirely.

When to Request Support

If the error persists after trying the steps above, gather the following information before contacting support:

Providing these details helps the support team diagnose the issue faster. You can submit your request via your hosting provider's support portal.

If you host with us, you don't need to do this yourself — just Open a Ticket and our Brisbane team will get it sorted.

Still Having Issues?

Need more help? If the issue persists after trying these steps, please open a support ticket and our team will assist you.

💻 Open a Ticket