WikiMedia have a new blog and a great new experience on scaling writes for WikiPedia, by doubling editing speed using HipHop Virtual Machine. Having WikiPedia written in PHP is an advantage and an inconvenient in the same time as it’s known that there are performances issues, especially that we are talking about a website serving pages to half billion of people monthly !
MediaWiki is written in PHP, a dynamic, loosely-typed language that has some natural advantages for a large scale website running on an open source software platform. PHP is a flexible language, suited to rapid prototyping, and has a low barrier of entry, making it relatively easy for novice developers to contribute. At the same time, PHP also has some disadvantages, including known performance issues.
As reading pages is not an issue, as is it could be solved by caching solutions, writing remain the main issue for most huge websites. And writing for WikiPedia mean articles, mean content, mean updates, and that’s their core business.
Hopefully for WikiPedia, as they are not the only top ten website written in PHP facing these performance issues. Facebook previously found a solution by building an alternative implementation of PHP that runs much faster than any other alternative : HipHop Virtual Machine (HHVM).
Implementing HHVM for WikiPedia was successful :
- CPU load dropped from 50% to 10%
- The mean page save time has been reduced from ~6s to ~3s
- The median page save time fell from ~7.5s to ~2.5s.
- The average page load time for logged-in users dropped from about 1.3s to 0.9s.
How WikiPedia switched to HHVM and much more interesting details you can read in this blog “How we made editing WikiPedia twice as fast” written by Ori Livneh, Principal Software Engineer – Wikimedia Foundation.