Hi all,
We have been having some problems where deleting pages takes a ridiculously long time -- something just less than minute. I tracked it down to a particular SQL statement that is getting held up due to another process holding a lock open. I can't figure out what created the lock, and why it's hanging. Could this possibly be a Mediawiki issue, or is this definitely a separate MySQL problem?
I see that this is query that is being blocked:
UPDATE /* 127.0.0.1 */ `page` SET page_counter = page_counter + 1 WHERE page_id = <page id>
Here is the Innodb status while the process hangs: http://pastebin.com/m1afe0b2
I'm not sure how to figure out what opened the lock and what that process was doing. It could be that my MySQL debugging skills are just woefully lacking. But I figured I'd post here to see if anyone else had seen something similar or had any ideas.
Thanks!
Nathan
Nathan Kinkade wrote:
Hi all,
We have been having some problems where deleting pages takes a ridiculously long time -- something just less than minute. I tracked it down to a particular SQL statement that is getting held up due to another process holding a lock open. I can't figure out what created the lock, and why it's hanging. Could this possibly be a Mediawiki issue, or is this definitely a separate MySQL problem?
I see that this is query that is being blocked:
UPDATE /* 127.0.0.1 */ `page` SET page_counter = page_counter + 1 WHERE page_id = <page id>
Here is the Innodb status while the process hangs: http://pastebin.com/m1afe0b2
I'm not sure how to figure out what opened the lock and what that process was doing. It could be that my MySQL debugging skills are just woefully lacking. But I figured I'd post here to see if anyone else had seen something similar or had any ideas.
Thanks!
Nathan
With many views, it will lock. page_counter is know to be slow. You can make it to be updated just on average by setting $wgHitcounterUpdateFreq to some largish value http://www.mediawiki.org/wiki/Manual:$wgHitcounterUpdateFreq
Or simply disable them $wgDisableCounters http://www.mediawiki.org/wiki/Manual:$wgDisableCounters
On Fri, Aug 7, 2009 at 6:30 PM, PlatonidesPlatonides@gmail.com wrote: <snip>
With many views, it will lock. page_counter is know to be slow. You can make it to be updated just on average by setting $wgHitcounterUpdateFreq to some largish value http://www.mediawiki.org/wiki/Manual:$wgHitcounterUpdateFreq
Or simply disable them $wgDisableCounters http://www.mediawiki.org/wiki/Manual:$wgDisableCounters
Interesting. Setting $wgDisableCounters = true; seems to have got around the problem, but I'm confused about why this would be so. I'm doing my testing on a testing instance of our wiki, an instance that gets no traffic at all. So this particular issue isn't related to load.
The query "UPDATE page SET page_counter = page_counter + 1 WHERE page_id = <page id>" should execute really quickly, and sure enough it does when I execute it manually ... less than 1/100 of second. The problem doesn't seem to be with updating the counter, but something locking the table or row and preventing that query from completing until the lock times out, which turns out to be around 52 seconds every time.
I could set $wgDisableCounters to true, but it seems like that is more of a workaround than a solution in this case.
Is is possible that something in the MW code is setting a lock and not releasing it explicitly, so the next query has to just wait for MySQL to time it out?
Thanks,
Nathan
mediawiki-l@lists.wikimedia.org