Help is on the way… ordered another server

September 12, 2008

This week, the site has been extremely slow and even gone down and up a couple of times.  I searched for a problem for a while but it appears that we’ve just really hit the wall on how much traffic we can support with our current servers.  That’s fairly good timing since we’d been planning to move to more servers for a little while, so I’d already begun to look into it.

Today I ordered another server with the same specs as the current Apache server.   This will bring us up to 5 total servers running LyricWiki.  For the curious (and tech-savvy): that’s one squid caching server in front of two Apache web servers which talk to one mysql master server and one read-only replica mysql server.

To get the server to be as beefy as we need, I had to ask the hosting company to order extra RAM for it.  So we’re just waiting for that to be delivered (hopefully around this weekend or very soon after) and we’ll be ready to start working to get the new server pulled into our setup.

In addition to just having more man-power machine-power to handle our traffic, this will give two additional benefits immediately.  The first is that we can use the new server to test out the upgrade to the newest version of MediaWiki (the software that runs our site as well as Wikipedia).  The second benefit is that now we’ll have two Apache servers – currently the most overworked part of the system – with one running the API and one running the site itself (lyricwiki.org).  This will let us more quickly identify when something is wrong with one of those two systems and it will make sure that problems with either of them are unlikely to effect the other.

Exciting times… stay tuned!

Advertisements

Don’t get pwned like we did!

June 1, 2008

Earlier this week we had some really strange errors on the site (detailed description here) that were caused by a mySQL bug which will eventually burn anyone who is running master/slave replication.

I mentioned that you’d need to write a script to prevent this problem from happening to you. The script would delete old, unneeded mySQL bin-log files. In the spirit of stopping this bug from affecting others, I’ve released a generic version of the script… you just have to set up a few variables in the “configuration” section at the top of the script and you should be good to go. For the code and info on how to make it run daily, see the “update” section of the post on my blog. It is, of course, free and open source.

Hope that helps someone!


3/12/08 9:30pm EST: Upgrading LyricWiki – expect outages.

March 13, 2008

We’re going to be upgrading LyricWiki to the newest version of MediaWiki.  This is good for a number of reasons, not the least of which is that the newest versions always have the lowest number of known security vulnerabilities.

There are also some new features that our extensions can’t work without.

Teknomunk was kind enough to jump right in and test/re-write a bunch of the extensions (I think all of them actually) to make sure they work in the new version.  He also made some upgrades which only work in the new version (which was what ultimately caused the decision to upgrade… so give him mad props :)).

Anyway… this is going to cause a lot of outages tonight.  I’m going to shut down the API (the SOAP), back up the database, then do the upgrades, fix what’s broken, then turn the API back on.   I’ll keep this blog updated as things progress.


Why our “stack” rules.

February 7, 2008

A “stack” is what tech people call their set of technologies that work together to run their application. It occurred to me recently how much LyricWiki‘s stack rules. We have only four servers and the web-server alone (which has an entire caching server in front of it, so this is just things that get past that) has been very comfortably handling more than 1.5 million pages per day. All of this and since I figured out this setup there haven’t been any slow-times even during the heaviest traffic. Did I mention this was only four commodity(cheap) servers!? How does it pull this off? Our stack is hardcore like Atreyu. Check it out:

The datacenter

The datacenter is a powerful beast at a great price. LyricWiki is hosted by G3 Technologies which has redundant everything and is on this cool Internet Exchange which puts our servers one-hop from an insane number of local Pittsburgh area people and campuses. We’re even one-hop away from Penn State (which is relatively far on a map). The fact that the place is so affordable is what has made it possible for LyricWiki to be supported only by non-invasive advertising.

The servers

LyricWiki is running on purely legal software for a total cost of $0. Win! Our operating system is CentOS which is basically the freely-compiled version of the same source-code as RedHat (G3 were the guys to tip me off to this; I naively hadn’t heard of CentOS 2 years ago). On top of the OS we have 3 different types of servers. A Squid caching server, an Apache web-server, and two mySQL servers (one is a replica/slave).

The application

The pages are written in PHP which is really efficient and is made much faster by APC op-code caching (this stores compiled versions of the code automatically since PHP is an interpreted language). The wiki itself is running the MediaWiki code (the same code that powers Wikipedia). I initially thought that MediaWiki was slow and bloated, but as time went on, I found out that in fact it is just optimized for very large wikis with a ton of traffic – this is because it was developed in conjunction with Wikipedia’s growth. One of my favorite features that was added into MediaWiki for scaling is the ability to instantly plug in the powerful in-memory object-caching system: memcached.

Other free stuff

On top of all of that, we’ve made heavy use of other technologies. ÜberBot, who added the first 200,000 or so songs to LyricWiki (to give it critical mass) was written in Perl which is fantastic at this sort of thing. We’ve also made search plugins for FireFox, Netscape, Safari, IE, etc. , a Facebook Application, and even leveraged the SOAP standard to make an API that has been used dozens if not hundreds of other places.

Third-party related tools

In addition to all of that stuff, we use Google Analytics and AWStats to track our stats.  The logo was made in the somewhat cumbersome but-hey-it’s-$400-cheaper-than-photoshop GIMP, and the code that I wrote for the site was written in Notepad++.  I’m sure I could go on and on listing other awesome (and almost always free) stuff that we use (IRC and even WordPress that I’m writing this on), but this post is getting long!

We use tons of amazing software and don’t have to pay for any of it! Brilliant! That’s kind of an interesting thing to notice being a programmer myself, but in the end that’s just something that the industry has to adapt to (much like the music industry with downloadable music).

I think I’ll leave you at that now. There was a TON of technology in there and I think I could write pages and pages about any one of the things I mentioned or linked to (except Atreyu, ironically), but that is for another day. If any of you are curious about any of the topics above, please comment on this post and it’s quite likely that I will expand up the topic later!

See how much our stack rocks? 🙂


Upcoming Outages (and upgrades!)

October 18, 2007

I’ve ordered $1,000 worth of RAM and most of it is going to be put into our existing servers tonight. The rest of the RAM is for a new server that I’ll be installing soon which will be a “Squid“. At Wikimania 2006, I was fortunate enough to be joined for lunch by one of the guys running Wikipedia’s Tampa datacenter, and he gushed over Squid. It really sounded fantastic, and we’re finally at a point with scaling where we can afford to get an extra box for this Squid. On Wikipedia, the reports are that this server can cache pages and serve around 70% of requests without having to go to the webserver/database server for anything. I expect this number will be considerably lower since we have a much smaller set of logged-out users, but it should still rock… hard (and keep up highly available if we are put on digg or LifeHacker again).

When I get word from my host about exactly when the RAM is going to be switched out, I’ll post more details. The Squid update should be within the next several days (not sure when yet… stay tuned for that also).


OpenSearch plugin for LyricWiki

May 4, 2007

If you have FireFox 2.0 or IE 7, we now have an OpenSearch plugin available thanks to Speckmade.

Just go to the site and there should be an option to install the new plugin. Unlike the previous search plugins, this will go directly to the page if there is a match. I, for one, will be using it constantly!