Last modified: 2011-04-30 01:20:44 UTC
Every request to our RSS/ATOM fires one apache child to 100% CPU for 30 seconds before PHP's maximum execution time of 30sec kills includes/diff/DifferenceEngine.php Our error.log shows hundreds of lines (read: hundreds of minutes) every day like includes/diff/DifferenceEngine.php(1257) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1257) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1264) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1248) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1261) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1258) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1258) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1257) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1261) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1256) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1257) : Fatal error - Maximum execution time of 30 seconds exceeded includes/diff/DifferenceEngine.php(1257) : Fatal error - Maximum execution time of 30 seconds exceeded The lines differ from about 1248 to 1264 with a stress on 1257. You may reproduce this by using wget for example: ----------------- $ time wget --no-proxy -O /dev/null "http://wiki.rhein-neckar.de/index.php?title=Spezial:Letzte_Änderungen&feed=rss" --2009-08-02 19:10:22-- http://wiki.rhein-neckar.de/index.php?title=Spezial:Letzte_%C4nderungen&feed=rss Resolving wiki.rhein-neckar.de... 62.138.134.203 Connecting to wiki.rhein-neckar.de|62.138.134.203|:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2009-08-02 19:10:52 ERROR 500: Internal Server Error. real 0m30.127s user 0m0.000s sys 0m0.006s ----------------- The server's CPU is a "Dual Core AMD Athlon(tm) 64 X2 Dual Core Processor 4200+" which should be more than adequate for a single instance mediawiki. I expect we had this problem before 1.13, we had it for 1.14.0 and now with 1.15.1. Please check http://wiki.rhein-neckar.de/index.php/Spezial:Version for installed extensions on our wiki. If you need more detailed informationen (configuration), please ask! If you want me to apply patches for testing/profiling/debugging, ... please ask! If you expect inconsistent data in out database, please send me some checkscripts. TIA Raphael Becker
Try using the wikidiff2 extension for diffs instead of the PHP-based diff engine.
(In reply to comment #1) > Try using the wikidiff2 extension for diffs instead of the PHP-based diff > engine. Thanks for you quick reply. According to http://www.mediawiki.org/wiki/Extension:Wikidiff2 this extension is declared "experimental". We need try this later, I don't have any root access to this server and therefore cannot modify the PHP setup on this server. I haven't seen this error on many other wikis I care of, so I guess there's nothing wrong with this piece of code in general (many other might have reported this before). Regards Raphael Becker
wikidiff2 is what Wikipedia uses, IIRC. The built-in diff engine is very CPU-intensive, since it's written in PHP. I'd assume that the RSS feed link is trying to generate a large number of diffs and simply takes too long. I don't know if this is fixable without using a diff engine written in a faster language, like wikidiff2.
I could have sworn there was a dupe bug entry but can't find it. The slow-diffs-breaking-things problem is old and well known, but we don't have a very good fix for it at the moment for those encountering it other than disabling feed diffs or installing the C++ differ. What we need here is the ability for the diff class to abort itself cleanly when it's taking too long, allowing for graceful degradation -- skip the slow diffs and just show everything else.
*** This bug has been marked as a duplicate of bug 7601 ***