Load Balancing WordPress In Multiple Data Centers

When you work for an enterprise level company, things need to be accomplished at an enterprise level. So, that is why we have taken a variety of wordpress implementations, from basic to complex plugins and begun load balancing WordPress. To make things more complicated, the servers involved are not going to be in the same location.

Load Balancing, Why Do It?

  • Redundancy
    If one of your servers crashes, hangs ups or experiences a hiccup, you have another hot one ready to serve pages.
  • Server Speed
    If you are overloading one server, obviously a second server will resolve some of the speed issues if you are having IO issues. This is only if you are TechCrunch or Huffington Post.
  • HTML Loading Issues
    If you are far away from the server, yes it could take a long time to view a page. Ever wonder how long it takes to reach your website from Buenos Aires. If you wanted to know, look at a service like Gomez or Keynote. Not sure of any free services out there to tell you this, and if you find one definitely let me know the URL!

WordPress On Multiple Servers

I am sure Automattic has been doing this for the larger clients at a fee, and that is where some of their revenue is coming from, because this is where the pain kicks in, while implementing WordPress. If you have two servers that need to split the WordPress traffic load, this will work fine, as long as you can call them both the same name, with separate IP addresses. This is where the loadbalancer does its job. Not an expert at loadbalancing, but I have heard of an F4. Basically, it splits the load and sends web traffic either round robin or on some algorithm to each site. It can be tweaked if one box is acting up or doing something wrong. If there is extremely high volume of traffic, you could go to many boxes, but then you may want to look at cloud computing.

Load Balancing Across Multiple Locations

Now this is where the bigger issues come into play. For instance, if you were to creating multiple load balanced servers in different data center, including different international locations, you will have to deal with the issue of syncing of files and of syncing of either DB latency issues or distributed DBs.

The MySQL Database Issues

Sudden MySQL and pretty much every DB becomes an issue when you are running a site in mutiple locations. You can do it, and we are going to be running WordPress in a multi server environment soon, so we can experience the latency first hand. By latency, we are referring to a site in one city, let’s say Houston, and the DB in Los Angeles. That would mean every DB query would have to cross the country and there would be some delay in the query result arriving. This would also mean that there is a chance the site will be worse off than before the new remote servers go online, and what would be the point of that.

Solutions For The WordPress MySQL DB Issue

First solution to consider is Caching of content. Looking at wp-cache 2, and Super Cache, it is possible to have the individual sites create their own cache locally after one DB hit, or the first one after the cache times out locally. This would only make sense if you have a website with little dynamic content. This is good for web pages, but for rapidly changing blog comments or forums, it does not work, because it would mean it never will update proper. However, experimenting with this is a good thing, and will help.

The second solution is to come up with a way for the MySQL DBs to be sync’d on a regular basis, preferably offline. Possibly one way would be every hour or 5 minutes a script would kick off and check for any changes. The changes would be sync’d to the other DBs in the distributed network and you would be able to keep all the sites local MySQL and speedy. Good luck on this one. Maybe a plugin to do this, is the answer.

How Many Uses Can Evernote Have?

Since listening to Guy Kawasaki Tweet (Another plug for Guy! Guy you have to follow me @dgudema for that one!) on about Evernote.com, I have been intrigued enough to start using Evernote, and after a while I came to the conclusion that this is a pretty good solution for virtual postit notes.

How Does Evernote Work?

Basically Evernote is pretty simple in what it accomplishes and that is creating virtual notes. I have annotated this in another article. Simply put you can store your bits of information like a postit, except virtually online. You can pull up these notes by tagging (a kind of categorization) and view them like square notes or by Detailed view. You can store HTML based notes (like URLS of websites) or you can store images or audio. And of course you can access this from an iPhone and I believe several other phones, which is the killer app part of it. Is it rocket science? No, in the complicated world we live in. Does it do the job well? Yes. That is all that matters.

How have I used it so far?

Personal Notes At Conferences
Personal Notes About Events
Personal Notes About What I have to do
Personally What I Have Done
Where I Need To Go
Website Addresses (so I can easly copy and paste them)
Comments About Websites
Pictures of homes that I am considering buying
Notes about homes that I am considering buying
Insurance numbers for the next hurricaine
Insurance numbers for the doctor
Some login info for obscure sites I don’t visit often
pictures of friends that I want to keep in a safe place, not just on the phone
Gifts that I want to remember to buy people
my wedding anniversary
my sons birthday
my sons friends names
tasks for my businesses
EINs and other business numbers, accounts
phone numbers
stocks I am researching or want to buy
Big Reminders

I guess Evernote suits me well because I don’t actually do well with the conventional calendaring that I also have in Outlook and in Google. Also not a replacement for Google Bookmarks… If you are a free spririt and use the physical notes that are all around you PC, then this is the place for you.