High Available WordPress (attempt I)

50 views
Skip to first unread message

PLOG

unread,
Dec 19, 2011, 1:17:12 PM12/19/11
to High Performance WordPress
Please find below a WordPress HA attempt :

http://www.slideshare.net/voxteneo/word-pressblogfarm

Not completely ready but it's the point. Any comment will be
appreciated.

Cheers

http://www.voxteneo.com/

Dan Gaul

unread,
Dec 19, 2011, 1:35:11 PM12/19/11
to high-performa...@googlegroups.com
Why are you using apache for high performance WP? Nginx seems like a much
better option.


--

-dan

http://www.digitaltrends.com

http://www.facebook.com/digitaltrendsftw
http://twitter.com/#!/digitaltrends
http://twitter.com/#!/dangaul

PLOG

unread,
Dec 19, 2011, 3:36:21 PM12/19/11
to High Performance WordPress
Hi dan,

We felt more confortable with Apache at this stage even if Apache is a
bit more "fat".
I had to find something feasible and stable in a couple of days.
I'll try harder with Nginx.

On Dec 19, 7:35 pm, Dan Gaul <d...@digitaltrends.com> wrote:
> Why are you using apache for high performance WP? Nginx seems like a much
> better option.
>
> --
>
> -dan
>
> http://www.digitaltrends.com
>

> http://www.facebook.com/digitaltrendsftwhttp://twitter.com/#!/digitaltrendshttp://twitter.com/#!/dangaul

Clement Yuan

unread,
Dec 19, 2011, 5:12:26 PM12/19/11
to high-performa...@googlegroups.com
everyone is comfortable with apache but nginx is more stable. I'm recommended W3 Total Cache.
--
Best Regards,
Clement Yuan (Mr)
Tech Specialist

John Bacon

unread,
Dec 19, 2011, 5:43:14 PM12/19/11
to high-performa...@googlegroups.com
Don't overcomplicate Nginx.  Install nginx and php-fpm using the repository of your linux distribution.  Dependencies are resolved and old packages updated.  If you're using Debian, http://www.dotdeb.org/ is great.

Rewrite rules are available at: http://codex.wordpress.org/Nginx

Those two things are all you need.  The links at the bottom of the codex page have good information as well.

:)

PLOG

unread,
Dec 20, 2011, 4:30:57 PM12/20/11
to High Performance WordPress
Thank you all,

No apache anymore.
http://www.slideshare.net/voxteneo/word-pressblogfarm updated.

Dan Gaul

unread,
Dec 20, 2011, 4:44:31 PM12/20/11
to high-performa...@googlegroups.com
I have a few other questions:

- What exactly are you serving via NFS?
- I'd look into running varnish and/or some type of CDN for at the very
minimum your static objects, and possibly full page caching if you can.
- Are you going to be using APC or some other op-code cache?
- Utilize memcached
- Did you look at alternatives to Super Cache, like Bat Cache or W3TC?

-dan


--


Dan Gaul
Digital Trends

http://www.digitaltrends.com

PLOG

unread,
Dec 20, 2011, 5:08:59 PM12/20/11
to High Performance WordPress
> - What exactly are you serving via NFS?
The hole WP php code is hosted on the server (the one bellow) via NFS
WP#1,WP#2,... run the code from there. So the wordpress directory is a
NFS mount.
This way I can duplicate hosts.

The NFS setup is too basic, as I have the NFS server as a single point
of failure.
Right now, if the NFS server fail, I'll have to switch to the other
"rsynced" NFS server.
(down time....)
I took a look at S3fs & GlusterFS, but did not have enough time yet.

> - I'd look into running varnish and/or some type of CDN for at the very
> minimum your static objects, and possibly full page caching if you can.
Indeed varnish is in my pipe too

> - Are you going to be using APC or some other op-code cache?
APC is installed on WP#1,WP#2,...

> - Utilize memcached
Well maybe with Amazon ElastiCache, but I will not
> - Did you look at alternatives to Super Cache, like Bat Cache or W3TC?
Not in detail

John Bacon

unread,
Dec 20, 2011, 5:25:52 PM12/20/11
to high-performa...@googlegroups.com
Congrats PLOG!  From here on out, it's all about growing.

Dan, varnish + nginx is redundant.  Even wp.com ditched varnish w/ nginx in favor of nginx everywhere possible.  Apache w/ varnish is a different story.

For those thinking of load-balanced multiserver setups, look at memcached w/ batcache.  It works across sessions and you can pool a slice of memory from each of your servers.  So, 4 servers, each with 256mb reserved for memcached = 1GB for your WordPress site(s).  Static caches, like WP Super Cache et al, work best on single servers.

Dan Gaul

unread,
Dec 20, 2011, 5:29:43 PM12/20/11
to high-performa...@googlegroups.com
NFS is going to be your biggest point of failure if you plan on doing high
traffic sites.

You will quickly run into a bottleneck there, especially with running PHP
scripts. I would highly recommend a deployment system to deploy your
scripts to each web server on updates and have the php files serve
directly off each, unless someone has another idea.

Any NFS/GFS/etc will have it's bottlenecks with IO/network latency when
serving small requests like those for PHP scripts IMHO, especially in a
high traffic environment.

What type of traffic are you expecting?

-dan

--


Dan Gaul
Digital Trends

http://www.digitaltrends.com

James Collins

unread,
Dec 20, 2011, 5:32:32 PM12/20/11
to high-performa...@googlegroups.com
How would you recommend dealing with the wp-content/uploads directory in a multi-server architecture?

Uploading media in WordPress would result in the file(s) being stored on that one server, and not on the other nodes?

Is there a reliable way to keep them in sync without having the uploads stored on an NFS share (and thus introducing a single point of failure)?

Thanks.

James

Dan Gaul

unread,
Dec 20, 2011, 5:51:40 PM12/20/11
to high-performa...@googlegroups.com
That is the trickiest part.

For us, we do it like this:
  • From the LB, point any uploads to a wp-admin/media server
  • Use a plugin to auto-upload the assets to a CDN
  • Serve these assets from the CDN
  • For redundancy, rsync the uploads folder between your web nodes in case there is a point of failure with your CDN or plugin.
In our case, we don't allow normal users to upload anything to Wordpress except a custom avatar.  It's pretty easy for us to just point those requests over to a single server.

From a wp-admin perspective, again, no need to use multiple servers for this.  We use a single server. All our assets are served off a CDN and are immediately uploaded to the CDN when uploaded to the admin server.  We then rsync on regular intervals to the other client facing web nodes. 

Granted, in this scenario you can then have the uploads folder be on NFS with the hopes that requests to it should be few and far between and you won't have the bottleneck.

-dan
-- 

Dan Gaul

unread,
Dec 20, 2011, 5:58:27 PM12/20/11
to high-performa...@googlegroups.com
Good stuff here.

In our setup, using Varnish in front of Nginx did help tremendously.  Granted, Nginx performs extremely well on its own, but we are doing full page caching and the extra benefit from Varnish has helped us out.

Definitely having a memcached pool will help tremendously.
From: John Bacon <john...@gmail.com>
Reply-To: "high-performa...@googlegroups.com" <high-performa...@googlegroups.com>
Date: Tue, 20 Dec 2011 16:25:52 -0600
To: "high-performa...@googlegroups.com" <high-performa...@googlegroups.com>
Subject: Re: [high-perf-wp] Re: High Available WordPress (attempt I)

PLOG

unread,
Dec 20, 2011, 6:37:57 PM12/20/11
to High Performance WordPress
I fortunately don't expect traffic peak in a near future.
This give the luruxy of time and practice.
About NFS, I use it to share the code and avoid to sync every nodes as
said James.
I wanted to avoid that since the beginning.
It would means cron, batch, rsync, whatever...
Rsync doesn't scale, and this way, if a user upload content, it's
centralized.

This subject is indeed THE issue of HA.
Beyond redundancy, it's a balance between scalability et performances.

I don't use CDN yet (the platform won't be use worldwide, it's more
national).
Dan you mention Use a "plugin to auto-upload the assets to a CDN".
I liked the idea to get the assets uploaded at the unique and right
place, allow the use of any node either for the Dashboard *and*
surfing.
This is the purpose of my second LB on the Nginx/NFS server.

"you can then have the uploads folder be on NFS with the hopes that
requests to it should be few and far between and you won't have the
bottleneck."
That my hope, as only uploads, and uncached/"non-opcoded"/... PHP code
request the NFS.
80% of the traffic is about images, CSS, JS, etc... (This is maybe
why I should concentrate on this part and not multiply CGI
nodes...mmm)

So, before playing with Varnish/Memcached/etc... and as I've got a bit
of time, I concentrate myself on the global architecture.

cheers
Reply all
Reply to author
Forward
0 new messages