Page MenuHomePhabricator

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

Description

Requesting https://commons.wikimedia.org/wiki/User:CommonsDelinker/commands?action=edit 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 https://commons.wikimedia.org/w/index.php?title=User:Rillke/CDC_mystery&action=history where I dump the profiling report of this page using https://commons.wikimedia.org/wiki/User:Rillke/profile.js -- about every third request fails.

Other users experience this issue as well:
https://commons.wikimedia.org/w/index.php?title=Commons:Administrators%27_noticeboard&oldid=104206956#Extremely_slow_performance_to_open_edit_interface_of_COM:CDC

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: http://toolserver.org/~delinker/helper.txt


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=53577
https://bugzilla.wikimedia.org/show_bug.cgi?id=49734

Details

Reference
bz54122

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:
Exmaple:
17:40, 14 September 2013 ( https://commons.wikimedia.org/w/index.php?title=User:Rillke/CDC_mystery&oldid=104315333 )

https://commons.wikimedia.org/w/index.php?title=User:CommonsDelinker/commands&oldid=104314668 ( https://commons.wikimedia.org/w/index.php?title=User:CommonsDelinker/commands&action=edit&oldid=104314668 )
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>
<hr><center>nginx/1.1.19</center>
</body>

</html>

https://commons.wikimedia.org/w/index.php?title=User:Rillke/CDC_mystery&oldid=104491400 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)