Support

Account

Home Forums General Issues 504 Gateway Timeout

Solved

504 Gateway Timeout

  • Hey guys, this is my first post.

    I’m fairly new to ACF, and i recently migrated a site from my local machine to live servers.

    On local i had no issues, but on live i get 504 gateway errors fairly often but they don’t follow a predictable pattern. Through trial and error I found out by disabling ACF the errors go away. I am wondering if the way i set everything up is causing the issue.

    I have a custom post type called ‘projects’ and that post type has a field group with 16 fields (including 8 image fields). I am using the_field() and get_field() to output this data on the front end. Could the repeated queries to the database be the problem? Or should i not be using the_field or get_field?

    Should i upgrade to ACF pro so i can use the image gallery field, would this help the problem?

    A little insight from someone with more experience will help me massively to solve the issue, i appreciate you taking the time to read my post.

    Thanks!

  • If everything is fine on local, but intermittently you are getting 504s on a live webserver that does sound like a load issue. Have you looked at what traffic the site is getting? Is it possible you’re being hammered by bot traffic?

    You don’t say how you are using the fields, but often if you have a bunch of custom fields, you have those custom fields because you want to be able to navigate and filter with them. If you can navigate and filter with them, you can easily end up with bots looping through your content and gobbling your server resources just by pulling stuff out of your database in every possible combination. PITA, truly.

    I am not sure it’s really an ACF issue, you can get the same thing happening with tags and categories if you have enough of them. If that is the issue, then caching, redis, and cloudflare bot protection might help.

    If it’s not that, you might find WordPress Query Monitor handy – it will give you a report to show what queries are running and how slow they are.

    Hope that helps. I’m not an admin, just another user!

  • Hey Cycas,

    Thanks very much for your response! You are correct this wasn’t an ACF issue, it ended up being a problem with the CDN feature my hosting provider had active by default.

    Your response though is useful! I appreciate you taking the time to help me out!

    All the best

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.