524 timeout

I’m consistently getting a 524 error in Wordpress backend when Publishing a Woocommerce Product. (I don’t have the problem when I save as a Draft.)

It seems I’ve exhausted all the options:

(1) Yes, there are some long-running processes here. The types of Products this is consistently an issue with have, literally, hundreds of Product Category (taxonomy) assignments… there is no way around this for our application as it has to do with the nature of the products fitting a great many user searches. (These are bike parts… they fit MANY different bikes and bike model-years, so there are a great many category assignments for these to indicate part fitment with various bike models/model-years.) When I create a simple product with, say, just a few product category assignments, I don’t have the 524 problem, which makes sense because the sheer number of categories being assigned in these more complex products is undoubtedly making for some slow queries, as confirmed using Query Monitor.

(2) I have tried implementing Elastic Search (through ElasticPress) in hopes that it could take over at least some of these backend queries whether WP_Query or WP_Term_Query. But while it does improve the frontend, it has almost no effect on the backend.

(3) I’ve done everything possible with our host to optimize the server, tame bot crawling, autoscale to meet increased process demand, etc. And if at all possible, I’d rather not have the change the hosts file to bypass Cloudflare for my admins. I’m also not keen on moving wp-admin backend to a (bypassed) subdomain.

Ok, so that sounds like a recipe for 524 errors, right? Long query processes from unusually large/complex product definitions… nothing can be done, right?

BUT… something seems off here. WELL BEFORE the “100 seconds” point where Cloudflare would timeout and give the 524, Wordpress indicates that “the connection has been lost” and autosaves the product – that’s after about 30 seconds of Publishing, not 100 seconds. I wonder… if this wasn’t happening (and why?), would I get to 100 seconds of no data returned by the origin server to CF?

SO, what are some reasons why the connection could break BEFORE Cloudflare breaks the connection with a 524?

Like EVERY host I’ve ever dealt with when there is a Cloudflare-related issue, it always seems to be “something you should contact Cloudflare about” and, magically, it’s just NEVER anything to do with the hosting. Ha!

The latest incident: Ray ID 645b56107e1204f7 (2021-04-25 23:28:04 UTC)

Thanks in advance for any insight anyone can give… :slight_smile:

Hello, what is the URL giving the 524 error?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.