I run several Mediawiki wikis and WordPress blogs on my Dreamhost shared hosting. I continue to work on improving performance on my wikis.
Here are some performance hints for the Mediawiki LocalSettings.php file I am running right now:
## Compress output if the browser supports it
# I commented this out in favor of wgUseGzip below. I -think- it offers better
# performance. LCS 5-6-08
# if( !ini_get( ‘zlib.output_compression’ ) ) @ob_start( ‘ob_gzhandler’ );
# Enable the basic file cache for static pages for non-logged-in visitors
$wgUseFileCache = true;
$wgFileCacheDirectory = “/home/.author/leedh/lee.org/[my temp folder]”;
$wgShowIPinHeader = false;
# I set wgUseGzip to be true and commented out the bit about ob_gzhandler
# above. I -think- this makes for better performance. LCS 5-6-08
$wgUseGzip = true;
$wgEnableSidebarCache = true;
#default is 1, changing to a higher number will be a little bit
# nicer to the database
$wgHitcounterUpdateFreq = 10;
$wgUseETag = true;
I also run my own PHP executable on Dreamhost and PHP_Fast_CGI. I didn’t take the time to install my own PHP. This is a bit of a hack but it works fine. I control the php.ini file… read below. The part I like the most is that I don’t have to manually upgrade PHP every so-often. Dreamhost will do it automagically. Here is an excurpt from the .htaccess file of the root of my website that tells all the PHP programs on my site to use my PHP and PHP_Fast_CGI.
# This is to run my own PHP and PHP_Fast_CGI. Since this is in the root
# of my web site, the whole website will run this way.
# note that I modified php5-wrapper.fcgi to run my own copy of PHP
AddHandler fastcgi-script fcg fcgi fpl
AddHandler php5-fastcgi .php
Action php5-fastcgi /php5-wrapper.fcgi
The contents of the php5-wrapper.fcgi file in the root of my account is:
# Run PHP with 2 persistant processes
# Run PHP
# Run my own PHP with increased limits
The php.cgi file in the cgi-bin directory is the PHP executable fetched from where it normally lives on the Dreamhost server at /dh/cgi-system/php5.cgi. Once a month I run this script to make sure I have the latest PHP. This script also fetches the php.ini and modifies it so I can upload files using PHP up to 100 MB instead of the 7 MB limit.
# This script copies over the latest php5 to my folder so I can run PHP locally.
# running locally lets me use my own php.ini (in the same directory as php.cgi)
# So then I can set the max post size and max filesize to larger than 7 megabyte
rsync -a /dh/cgi-system/php5.cgi “$CGIFILE”
# REMOVE THE FOLLOWING LINE TO CREATE THE UPDATE-ONLY SCRIPT:
cp /etc/php5/cgi/php.ini “$INIFILE”
perl -p -i -e ‘
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;