Page MenuHomePhabricator

Opening Commons Delinker command page on wiki sometimes returns HTTP 504: Gateway Timeout -- SQL query sometimes super slow
Closed, ResolvedPublic


Requesting often returns

HTTP 504: Gateway Timeout.

This does not happen when requesting the page with a high frequence but if you do it e.g. once an hour. Just look at where I dump the profiling report of this page using -- about every third request fails.

Other users experience this issue as well:

If I remember correctly, this is an issue for a long time. Updating the page via API often works without any issues (but is slow). The page is regularly queried and updated by a bot:

Version: unspecified
Severity: normal
See Also:



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:47 AM
bzimport set Reference to bz54122.
bzimport added a subscriber: Unknown Object (MLST).

Isn't this just the "standard" timeout for (uncached/just edited) pages with a lot of templates, like [[m:User:Cbrown1023/Logos]]?

(In reply to comment #1)
The issue is that there were not a lot of templates on the page at the time the requests failed:
17:40, 14 September 2013 ( ) ( )
CPU time usage 0.656 seconds
Real time usage 0.767 seconds
Preprocessor visited node count 1285/1000000
Preprocessor generated node count 4672/1500000
Post-expand include size 60326/2048000 bytes
Template argument size 29773/2048000 bytes
Highest expansion depth 12/40
Expensive parser function count 33/500

So here is the complete message:
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>

</html> 22:37, 16 September 2013

If you need a special response header for debugging, please let me know.

And I found something interesting:

The following took ~50s!

query: SELECT log_id,log_type,log_action,log_timestamp,log_user,log_user_text,log_namespace,log_title,log_comment,log_params,log_deleted,user_id,user_name,user_editcount,ts_tags FROM logging FORCE INDEX (page_time,user_time,log_user_type_time) LEFT JOIN user

Can a tech please confirm this is an instance of Bug 53577 ?

Sean: Could you answer comment 6, please? Thanks in advance!

The truncated query in comment #6 comes from the same class as bug 53577 but forces different indexes. So, possibly it's the same type of problem, but need to see a complete example.

(In reply to comment #8)
Is there anything I could help with?

This error is not in the tool's code though, adding keyword

There is nothing the maintainers of the tool can do here, so it shouldn't be a bug of the tool, IMHO.

I see. Thanks for correcting me!

Is that still an issue experienced?

Is that still an issue experienced?

(In reply to Andre Klapper from comment #14)

Is that still an issue experienced?

Sorry for the late reply.. Nope. Worked fine in the last months.

(Maybe a other software change fixed this, closing now as RES - FIX)