Brion Vibber wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Daniel Friesen wrote:
For lighttpd vs. Apache. lighttpd is a lightweight webserver, and does have a real performance benefit over serving out images with bloated Apache.
We started using lighty to serve images in 2005: http://meta.wikimedia.org/wiki/November_2005_image_server
Domas did a fair amount of benchmarking and testing on this over the months prior to the switch, including working with the author on some fixes, and it was a pretty clear winner at the time.
As for lighttpd vs. nginx... I believe the author of lighttpd actually had some contact with Wikimedia, perhaps a bit of changes were made to lighttpd or something for them... Dunno... So whether anyone else gos for lighttpd vs. nginx there's no relevant benefit of one over the other.
Well, to be honest I never heard of nginx before today. :)
- -- brion
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAki0SkQACgkQwRnhpk1wk46O0wCgkAbv8gM5/LTWBvoZD5logxcF ZNsAn2K0G34CRGUQHQ0bYH7aX/8z31Ir =uUIu -----END PGP SIGNATURE-----
Heh, that's amusing... Jae poked me about it all the time back on the old Wiki-Tools project. http://nginx.net/
http://survey.netcraft.com/Reports/200806/ http://hostingfu.com/article/nginx-vs-lighttpd-for-a-small-vps http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-perform...
I love how I have it setup for my own MediaWiki sites. I passed off nginx on the old wiki-tools project as we couldn't find a single way to get nginx to work with short urls. When the second wiki-tools project came around I made yet another attempt at it... I even attempted using real complex rewrites. I manged to get it to sorta work... well, short urls worked, and amperstands didn't have an issue... well, to a limit... heh, the regex I used worked, but not all to well... ^_^ after a certain number of amperstands in the title, everything just sorta... went white... heh Some time after that I suddenly thought of a bit of a brilliant idea. Just came to me, ^_^ and personally I find it beautifully elegant. More beautiful than anything you could ever do with a rewrite...
location ~ /(index.php5?/|wiki|view|render|print|viewsource|purge|(form)?edit|submit|history|info|credits|(un)?watch|(un)?delete|revert|rollback|(un)?protect|markpatrolled|validate|deletetrackback|dublincore|creativecommons) { include fastcgi.conf; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param PHP_SELF /index.php; fastcgi_param SCRIPT_URL /index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_pass php; }
include /etc/nginx/default.conf; include /etc/nginx/php.conf;
The one line is a bit long because I have an affinity for action paths. Honestly, that could be reduced to a single "location /wiki {" line if you just wanted short urls (actually that's what I basically listed on the English nginx wiki.
Quite simply... the regex matching "/wiki", "/edit", etc... whatever... matches as if it was a directory and $fastcgi_script_name matches whatever's after it. ie: /wiki/Foobar, $fastcgi_script_name is /Foobar Really the PATH_INFO is just there for a preference on completeness. MediaWiki uses the REQUEST_PATH so it's not really used (actually that's a good thing, since I needed to add a / after the index.php5?). Basically it takes all those requests and points them to /index.php, basically funneling all those through MediaWiki using it as a web application.
No cruddy rewrite rules trying to rewrite some ugly path into something that vaguely matches a query to index.php... Instead all requests to the wiki are just funneled through the wiki letting the software handle all the paths like it was built to.
Sorry bout the long code... It's just I get an indescribable feeling looking at this kind of elegant code, I was in awe for a fair bit of time after this idea hit me and worked...
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --The ElectronicMe project (http://electronic-me.org) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) --Animepedia (http://anime.wikia.com) --Narutopedia (http://naruto.wikia.com)