The only page that looks much different from Wikipedia or any other MediaWiki-based wiki is the Special:Version page. I've included a screen-grab of that so you can see how my version is different from the mainstream MediaWiki engine. In particular, notice IIS instead of Apache, the ADOdb library and SQL Server instead of the MySQL library and MySQL, and a slightly different version of PHP (this is the version from Zend Core)
2007-05-25
2007-05-17
More speed tests
Having been pleased with the effects of the Zend Optimizer, I began to wonder what the effects would be of running the entire MediaWiki software on the commercial Zend Core engine.
Here are some samples (all times in seconds):
Note that these are the times reported by PHP (as can be seen with the view source command on the resulting web page). Also note that the times vary significantly depending on what the server may be doing at the time. The times reported for my server are for uncached results, whereas the times reported for Wikipedia are presumably usually for cached results -- except for Arnold, it looks like I found him out of the cache this time around!
Page | PHP No optimization | PHPw/Optimizer | Zend Core | Wikipedia |
---|---|---|---|---|
2003 invasion of Baghdad | 3.32 | 3.20 | 0.69 | 0.34 |
2003 Invasion of Iraq | 20.76 | 5.45 | 6.66 | 4.09 |
Air Force Special Operations Command | 1.16 | 0.63 | 0.48 | 0.21 |
World Geodetic System | 1.32 | 1.75 | 1.30 | 0.36 |
United States Department of Justice | 2.03 | 0.94 | 0.77 | 0.54 |
United States Air Force | 6.47 | 7.24 | 2.17 | 1.17 |
The Sunshine Boys | 1.93 | 0.82 | 0.62 | 0.37 |
Ruby on Rails | 1.751 | 5.88 | 0.65 | 0.25 |
PowerPoint | 3.99 | 2.07 | 1.24 | 1.68 |
Lee Meredith | 0.85 | 0.53 | 0.37 | 0.18 |
Arnold Schwarzenegger | 15 | 7 | 3.9 | 14.03 |
Philippines | 25 | 5 | 5.6 | 3.51 |
2007-05-11
Version 1.10 on SQL Server
MediaWiki 1.10 is out. That's my cue to start trying to get my changes integrated into the shared source code. I've started on that with a Bugzilla, Bug # 9767
I pretty much have 1.10 all working, except the thumbnail functionality stopped working. In my configuration, ImageMagick 6.3.2-5 is used to generate the thumbnails. Now, instead of thumbnails, I get "Error creating thumbnail: The input line is too long". The first part of this message, up to the colon, is generated by the PHP code. The second part, however, appears to come from ImageMagick itself. In my modified MediaWiki version 1.9.3, this had been working -- so I need to figure out what's changed.
(... a little time goes by ...) OK, It's not ImageMagick's fault. The problem had to do with the documented (http://news.php.net/php.internals/21796) flaw with PHP's invocation of cmd.exe. My implementation of the wfShellExec function in GlobalFunctions.php now contains this:
...
} elseif (php_uname( 's' ) == 'Windows NT' ) {
# This is a hack to work around PHP's flawed invocation of cmd.exe
# http://news.php.net/php.internals/21796
$cmd = 'cmd /C ' . '"' . str_replace( '/', '\\', $cmd) . '"';
}
wfDebug ( "wfShellExec: $cmd\n" );
$output = array();
$retval = 1; // error by default?
exec( $cmd, $output, $retval ); // returns the last line of output.
return implode( "\n", $output);
}
Note that this differs in two ways from the distributed version of GlobalFunctions.php:
- Prefixes the command with "cmd /C"
- Replaces all occurrences of slash with backslash
Making it fast
Until today, I have been reasonably disappointed at the speed at which the pages in my wiki have been coming up. Wikipedia uses lots of stunts which aren't really open to me, like using Squid together with lots & lots of slaved servers. Right now, I'm just running on a two-processor (2 x 3GHz Pentium) box with 2GB of memory. SQL Server, IIS, etc. are all running locally. In this configuration, pages were taking anywhere from 2 to 10 times as long to display as the corresponding pages from Wikipedia.
The fix is in. I suspected that a PHP accelerator would work, and it does -- beyond my expectations. All of a sudden, this wiki is snappy!
The trick is getting a PHP accelerator that works in our configuration (Windows 2003 SE, IIS 6, PHP 5, etc.) The one that does it is Zend Optimizer. It's a free download. Thanks, Zend. If you're running any PHP on IIS, give it a try. I think you'll be impressed.
Here are some example timings for my wiki, along with times from wikipedia.org:
Page title | Time before optimizer | Time after optimizer | Wikipedia time |
---|---|---|---|
Philippines | 25 seconds | 5 seconds | 4 seconds |
Arnold Schwarzenegger | 15 seconds | 7 seconds | 5 seconds |
Subscribe to:
Posts (Atom)