Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 !

share|improve this question
1  
+1 for the "I never thought of doing that" effect. –  Richard Slater Feb 2 '10 at 13:36
1  
+1 for "I hope someone provides a really great answer with step-by-step instructions on the best way to implement this and why it is the best way". –  Jed Daniels Jun 17 '10 at 17:09
    
just added on what we end up doing - hope this helps –  rihatum Jun 30 '10 at 15:27

7 Answers 7

up vote 3 down vote accepted

If those directories need to be identical, could you put them on another server and mount them remotely via NFS?

share|improve this answer
    
We have a SAN ; so we installed wordpress onto the SAN and added that directory in IIS as the wordpress/blog directory. Thanks everyone for the comments ; –  rihatum Feb 26 '10 at 9:40
2  
A SAN is not the same thing as NFS. –  chris Jun 17 '10 at 17:10
3  
Share sessions with Memcache, share files with NFS or GlusterFS. Share traffic with HAProxy or Varnish (caches too!), and share databases with circular replication. –  Tom O'Connor Jun 30 '10 at 14:03
    
GlusterFS is a fascinating suggestion - thank you for that. I'm exploring that as a solution to my Wordpress scaling of static stuff. –  Artem Russakovskii Oct 10 '11 at 9:37

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.

share|improve this answer

First up, answered a very related question over here you will probably find helpful: http://serverfault.com/questions/74818/san-mysql-replication-is-that-what-i-want-for-my-load-balanced-drupal-cluster/74986#74986

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.

share|improve this answer

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.

share|improve this answer
    
+1 WordPress also has caching plugins which can do a really good job. There's no reason to run WordPress across two servers like this with a decent amount of caching enabled. –  kaerast Jun 30 '10 at 14:04
2  
Load balancing isn't just about performance, its also about adding redundancy. –  Mike P Jun 29 '12 at 23:26
    
When you mention WP Super Cache you should also mention W3 Total Cache –  david Nov 29 '12 at 0:33

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!

share|improve this answer
1  
I would advise against using a plugin that hasn't been updated since 2009 - it's unmaintained and you may regret it in the future (S3 changes, security, etc). –  Artem Russakovskii Oct 10 '11 at 10:05
    
FYI, we are still running fine with this plugin. –  shennyg Oct 12 '11 at 23:13
    
@shennyg - still going strong? –  Steve Jul 3 at 17:18
    
@Steve wordpress-s3 is unmaintained. I'd go with w3 total cache, it can sync your Media Libraries. –  shennyg Jul 30 at 19:29

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

share|improve this answer
    
...except that DRBD provides a block device, which hardly is equivalent to a file system. –  andol Jun 30 '10 at 15:52
    
...and I can then choose which file system to format it with, which provides far more scope for indecision than being stuck with NTFS ;) –  Terence Johnson Jul 3 '10 at 5:31

sessions are better shared via memcache then on the filesystem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.