User:Gordon/Free Geek Wiki Upgrades

From FreekiWiki
Jump to navigation Jump to search

Problem

The wiki is slow, especially when saving pages. It is also running an installation of Mediawiki that is terribly out of date, and the server is still running Debian etch.

Solutions

Solutions are presented in increasing order of work and impact on the Mediawiki virtual server. By far the cheapest and quickest solution to the speed problem is to install APC; see below.

PHP opcode/object caching

Install a PHP opcode cache and give it 32-64MB of RAM. I use APC on the wikis I administrate. APC has the advantage of direct support by Mediawiki.

I run one wiki that gets 200K or more hits a month on a VPS with 360MB of RAM. I gave APC 48MB for its cache and noticed a very significant speed increase after it was installed. Looking at my stats, there is a 99.7% cache hit rate on my installation, and I am running other PHP apps in addition to Mediawiki. So, 48MB should be more than sufficient for APC on Free Geek's Mediawiki virtual server.

Having installed APC, I found that there was no need for memcached based on the load my other wikis experience. Since it was a long time ago, I'm unsure now whether Mediawiki also uses APC as an object cache; if so, this might obviate the need for something like memcached on a modestly-used wiki such as Free Geek's.

Upgrade Mediawiki

Free Geek is running on Mediawiki 1.12.0, which upon examination by Vagrant, appeared to be a Lenny package running on an Etch server. Either way, 1.15.1 is the current stable release. 1.12.0 is very out of date and undoubtedly plagued with various security issues. As well, the virtual server should probably be upgraded to Lenny so that security fixes to PHP and MySQL will continue farther into the future.

I've administrated Mediawiki sites since 2005 and am fairly knowledgeable about it. I also have about 9 years of experience as a Debian user and system administrator. I run Debian on my VPS and am most familiar with it of all distros. Therefore, if the Free Geek staff are willing to trust me, I would be happy to work on upgrading the wiki software and server, possibly on a Sunday when few people are using it if that's possible.

There are 4 options:

Stay on Etch and look for a newer backport

This is the easiest potential solution that will be obsolete in the shortest amount of time.

Stay on Etch and convert to a manual installation

This saves the work of upgrading the virtual server to Lenny.

Upgrade to Lenny (or beyond) and use Debian packages

This option is fairly self-explanatory. Easier to maintain, harder to keep up on critical patches to Mediawiki given the inability of Debian to quickly handle every one of the billion PHP-related security patches a month. Also, if anybody is interested in having me work on the wiki, I am least familiar with this method because despite using Debian for my servers, I always install Mediawiki by hand. I suspect that it is pretty easy to pick up, however.

Upgrade to Lenny and convert to a manual installation

This is more difficult to maintain (marginally -- it's actually pretty easy but not solely an apt-get solution) but, if the will is there to maintain it, Mediawiki can be kept better up to date.

Still slow?

  • Convert most non-fulltext-indexed database tables to InnoDB if they are not already (this should be done regardless to prevent eventual corruption-related sadness)
  • Investigate whether memcached would provide a performance benefit beyond APC, considering that Mediawiki may be using APC as an object cache as well as an opcode cache
  • If the server is under load due to serving a lot of static content, investigate using something like varnish to efficiently cache and serve it (better than squid)