I have to install wordpress (One Blog, one domain, for e.g. mycompany.com/blog) on two servers sharing one database on a different server, these two servers are behind a loadbalancer and the db would be on another server. We are planning this way due to high traffic.
I have done standalone wordpress installations on a single server, on windows 2003, 2008 with IIS6, 7 etc
I am just researching as to how would I implement this.
What would be the steps to achieve this and upon searching I saw some posts regarding the wp-content/uploads directory to be synced at regular intervals ?
your help much appreciated Thanks for reading
What we did :
a) We have two web servers connected to a san cluster b) created a blog directory on the san c) Mapped that blog directory as a virtual directory on both webservers d) Installed wordpress on any one of them (as the domain and IIS virtual directories is the same for both servers - for e.g. www.abc.com) e) Database for this blog is located on two MySQL Boxes
as Wordpress is sitting on the san, so no conflicts with uploads or anything like that, Blog url is www.abc.com/blog and that's how it is configured on both.
Hope that helps someone !
If those directories need to be identical, could you put them on another server and mount them remotely via NFS?
There are so so so many ways to improve wordpress performance that don't require a second server and load balancing. In two words: "cache everything".
Use a php opcode cacher (APC). You can easily achieve 90% cache hit rates with wordpress in under 64MB of mem.
Enable mysql query cache. You can easily achieve 65% or > cache hit rates with very little mem (site dependent, but never too high).
Most importantly:
Wordpress is a heavy "read" site (vs. write) with most requests limited to a few hundred pages (blog posts). You can increase the requests per second 10 fold by serving static versions of your most popular posts. The best plugin for that is: wp-super-cache. I am not positive if that particular plug-in is compatible with 2k3, but the general idea of automatically creating static versions of your pages and periodically updating them to include new comments, edits, etc is going to be your best bet.
I truly doubt you're site will be doing enough traffic to require two web/app servers if the above common enhancements are implemented(the above can easily handle the slashdot effect). However, two web servers would add a level of fault tolerance. Since performance can be achieved with one web server, then fault tolerance can be achieved using an active/passive setup. This would be simpler and require no sharing of session information.
We ran into the same situation, ended up installing an s3 plugin that hosts your wp uploads directory so you don't have to deal with the syncing.
This is the one we used: http://tantannoodles.com/toolkit/wordpress-s3/
It has been working great so far!
You must share between servers the uploads/dir, and the sessions dir , usually in /tmp
Change it in php.ini and share the fs for sessions and uploaded files between servers via samba, nfs or what you prefer.
First up, answered a very related question over here you will probably find helpful: SAN + MySQL replication- is that what I want for my load-balanced Drupal cluster?
Web clustering can go really far down the rabbit hole, so its important to keep your business goals in mind and not get lost in engineer one-upsmanship. For instance, you're planning on having two webservers and one database server... but what if the database server is your bottleneck? Then your second webserver is wasted. On modern hardware with one webserver and one database server and a well configured wordpress you can handle a couple hundred requests per second. Are you expecting that? If not, there's probably no point in loadbalancing.
sessions are better shared via memcache then on the filesystem.
On a Linux pair, I would use DRBD. The Windows equivalent is the Distributed File Service.
http://technet.microsoft.com/en-us/library/cc753479%28WS.10%29.aspx