504 Gateway Timeout: What It Means and How to Fix It

A 504 Gateway Timeout error means a server in the middle -- a proxy, CDN or gateway -- waited for the server behind it to answer, and gave up because no answer arrived in time. In plain English: something took too long. This guide explains what the 504 Gateway Timeout means on Instant Access Internet Services hosting, the usual causes, and how to fix it.

What the 504 error looks like

  • 504 Gateway Timeout or Gateway Time-out.
  • Chrome and Edge: "This page isn't working ... took too long to respond. HTTP ERROR 504".
  • A branded Cloudflare (or other CDN) error page. Note that Cloudflare shows its own code, 524 A timeout occurred, when our server connected but took too long to finish; the fixes below apply to both.

A 504 is different from a browser message such as ERR_CONNECTION_TIMED_OUT, which means your browser couldn't reach the server at all. That one is covered in its own guide.

Common causes on our hosting

CauseClues
A slow or long-running scriptOnly one page or action fails: a large import or export, a backup plugin, a report, a bulk image resize, a big WooCommerce order search. Our web server allows a request about 120 seconds before timing out.
A slow outside serviceYour site waits on an outside API (payments, shipping rates, social feeds, license checks) that is slow or down.
A CDN or proxy in front of the siteThe error page has CDN branding. CDNs usually have a shorter time limit than our server.
Slow database queriesPages with searches, filters or reports are slow; the database has grown very large, or a plugin runs heavy queries.
Hitting resource limitsRequests queue up during busy times until they time out. Resource Usage shows faults.

How to fix it as a visitor

  1. Wait a minute and reload. Timeouts during a traffic spike often clear quickly.
  2. Don't resubmit a form or payment over and over -- check your email or account first to see if it went through.
  3. If you're on a VPN or proxy, turn it off and try again.

How to fix a 504 on your website

1. Find which page or action is slow

Note exactly what you were doing when the 504 appeared. If it's one task (an import, a backup, a report), that task is the problem, not the whole site. Check Metrics > Errors in cPanel and the error_log file in the folder of the failing page for lines such as Maximum execution time ... exceeded or errors naming a plugin.

2. Break big jobs into smaller pieces

  • Import or export in smaller batches (many import plugins have a batch size setting).
  • Import large databases from a file under 50 MB in phpMyAdmin, or split the file.
  • Run heavy jobs from a cron job instead of the browser. In cPanel, go to Advanced > Cron Jobs. Cron jobs aren't limited by the browser or CDN timeout.
  • Schedule backups with WP Toolkit or rely on our automatic JetBackup 5 backups instead of running a heavy backup plugin during busy hours.

3. If a CDN is in front of your site

  1. Pause the CDN or set the record to DNS-only and try the same action. If it works directly, the CDN's time limit is the issue.
  2. Run long admin tasks with the CDN bypassed, or move them to a cron job.
  3. Check the CDN's DNS records point to your hosting account's IP address (shown on the right of the cPanel home page under General Information).

4. Speed up the site

  • Turn on LiteSpeed Cache so most pages are served without running PHP.
  • Deactivate plugins you don't need, especially "related posts", statistics and security scanners that run heavy database queries.
  • Clean up the database: old revisions, spam comments and expired transients. Optimization plugins or the LiteSpeed Cache Database tools can help.
  • Check Metrics > Resource Usage for faults. If you see them, reduce the load before anything else.

5. Check outside services

If the 504 happens only when a plugin contacts another service (checkout, shipping rates, a feed), check that provider's status page, update the plugin, and turn on any caching or timeout option it offers.

Common questions

Can I just raise the timeout?

You can change PHP's own time limit in Software > MultiPHP INI Editor, but the web server and any CDN have their own limits, so a longer PHP setting won't stop a 504 on its own. Making the task faster or moving it to a cron job is the reliable fix.

What's the difference between 504 and 502?

A 504 means no response arrived in time. A 502 Bad Gateway means a response arrived but it was invalid.

Did my action go through even though I saw a 504?

Often yes. The script may keep running after the gateway gives up. Check before repeating an order, import or email send.

When to open a ticket

Open a ticket if every page times out (not just one heavy task), if the 504 happens without a CDN, or if cPanel and webmail are slow too. Include the full URL, what you were doing, the time, whether you use a CDN, and any lines from error_log.

Related guides

Still stuck? Open a support ticket and the Instant Access Internet Services team will help.

Ultrafast LiteSpeed hosting from InstantAccess.net: free SSL, free backups, cPanel included, no contracts. Check out our $10/month hosting.
  • 504 gateway timeout, http error 504, 504 gateway timeout wordpress, gateway timeout error fix, 504 cloudflare, server took too long to respond
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

429 Too Many Requests: What It Means and How to Fix It

A 429 Too Many Requests error means something decided that one visitor, program or website sent...

500 Internal Server Error: What It Means and How to Fix It

A 500 Internal Server Error means the web server hit a problem it couldn't recover from while...

400 Bad Request Error: What It Means and How to Fix It

A 400 Bad Request error means the server received a request it couldn't understand, so it refused...

401 Unauthorized Error: What It Means and How to Fix It

A 401 Unauthorized error means the page you asked for needs a login, and the server didn't...

403 Forbidden Error: What It Means and How to Fix It

A 403 Forbidden error means the server understood the request but refused to show the page....