Picture the scene, you’ve had a great idea for a blog and have decided to use WordPress as your blogging software of choice. And as you’re going to be getting an insane amount of visitors (after all, you’ve got a great idea, right?) you’ve decided to buy some decent hardware to cope with the traffic.
The setup you’d probably go for is some sort of load balanced setup, with multiple web servers and possibly a couple of database servers behind the scenes. You should also be thinking about the wonders of virtualization and all the benefits that brings but that’s for another day.
Having multiple web servers brings about its own set of issues. Your blog code needs to be deployed to all web servers (preferably at the same time) so that if you get visitors that happen to hit different machines, you give them the same experience.
Deployments and Uploads
However, in this kind of setup, you’re going to come unstuck with plugins, themes and uploads. WordPress has an awesome upload utility, but the file you select from your local computer will get uploaded to a location on a single machine in your server farm. When a visitor lands on a different machine, they won’t see the upload. If you’re using the automatic add plugin or theme wizard built into the newer version of WordPress then it’s the same situation.
Link to NFS locations
But the situation is not nearly as dire as you may think though. There are loads of ways to combat it – and it’s a piece of cake if you’re using Linux! The easiest way is to create an NFS share on web server 1 and link to it on web server 2 so that the “/plugins” directory on 2 actually points to the location on 1. Easy!
If you’ve got a file server, even better – create your NFS on there and link to that location instead so that content really is separate from your code!
With windows it’s just as easy with shared directories – same principle, just a different terminology.
The only issue you’ve got left is that some plugins may have the paths to their files built slightly oddly so that they load the wrong files. But then, if you’ve got errors with the plugins, it may be time to look for alternatives!
Have you had any problems with WordPress on load balanced servers? How did you solve it or did you choose another setup?
No related posts.Tags: ant, capistrano, load balanced, NFS, WordPress, wordpress plugin on NFS