I've been administering Wordpress blogs for almost a decade now; hosting for ... 5? 6 years? I'm not sure any more. Anyhow. I started with Apache. Apache probably works fine if you load the mpm-oh-you-didnt-know-about-mpm-so-sorry module. My next stop was lighttpd. A fine piece of software, with a persistent bug that caused it to drop into a 500 state if FastCGI instances were ever unavailable. So now I'm on Nginx. A…
"One thing that always surprises me is seeing configurations where Nginx is merely a proxy or load balancer into a bunch of Apache instances. Are you nuts? Stop doing that. Just use Nginx and FastCGI -- thank me later." Problem is - you can't flush the output buffer.
Wordpress.com serves 70k requests/second using Nginx
71–80 of 97 posts
Re: Wordpress.com serves 70k requests/second using Nginx
#72Earlier quoted context omitted.
Wordpress is only reasonable fast if you use APC, memcached and the MySQL query cache. I never liked the caching plugins. If you use nginx just use the fastcgi_cache module and make cookies part of the cache key or omit the caching of pages where the login cookie is set.
APC+mysql cache (not just query but keycache too) is a must, but memcached is pointless unless you have a multi-server website (on a single server APC shared memory is way faster than memcached). All logged out users should be served a completely cached static page that bypasses PHP entirely, it's way faster than even an opcode cache and way less load. WP-Super-Cache can serve static pages to logged out users and mak…
It's also great to have the flexibility of adding more servers in case of a huge spike, even if you are running on only one server. Like on Heroku, where you can just increase the number of dynos in realtime. Doing that without a central cache that every server can access can break your MySQL because each new server will have a cold cache.
Re: Wordpress.com serves 70k requests/second using Nginx
#73Earlier quoted context omitted.
It's definitely not one load balancer, but nor is it 70krps distributed across 2000 servers. I also think having only one per datacenter would be a bit risky -- I'd have at least 2. It's very frustrating that the article doesn't make clear how many load balancers they run.
WordPress.com currently has 12 load balancers per data center. They are HA and used for different subsets of traffic.
70 000 / (4 * 12 * 12) = 121.52 request per CPU
Re: Wordpress.com serves 70k requests/second using Nginx
#74I've been administering Wordpress blogs for almost a decade now; hosting for ... 5? 6 years? I'm not sure any more. Anyhow. I started with Apache. Apache probably works fine if you load the mpm-oh-you-didnt-know-about-mpm-so-sorry module. My next stop was lighttpd. A fine piece of software, with a persistent bug that caused it to drop into a 500 state if FastCGI instances were ever unavailable. So now I'm on Nginx. A…
Re: Wordpress.com serves 70k requests/second using Nginx
#75This figure is not from a single instance though. When running a single instance of WP I've always found it to be fantastically slow. The greatness in the described stack really lies in Nginx. It's really not WordPress serving 70k requests here, it's some decent load balancing that achieves the effect. The title is somewhat misleading.
Re: Wordpress.com serves 70k requests/second using Nginx
#76Earlier quoted context omitted.
I'd be interested in seeing your 'fancy footwork' for the rewrite rules :)
Edit: actually, it looks like this doesn't work the way I think it does ... looks like nginx has changed enough between 0.7 and 1.0 that my original config doesn't work as correctly as it used to. Edit 2: Actually I think WP Supercache is the one that changed. Edit 3: This config looks more up-to-date than mine -- http://rtcamp.com/tutorials/nginx-wordpressmultisite-subdoma... I particularly liked how they used the t…
I really think Nginx in still underestimated by large. Most article handles rewrite in nginx based on their Apache knowledge.
Nginx's try_files is magical. So does maps{..} section.
Using Nginx map, you can server static files in WordPress-multisite without PHP (much better than X-SendFile or X-Accelredirection). On large wordpress-multisite network, this can really increase Nginx's capacity by multifold.
See - http://rtcamp.com/tutorials/nginx-maps-wordpress-multisite-s...
Re: Wordpress.com serves 70k requests/second using Nginx
#77Earlier quoted context omitted.
I'd be interested in seeing your 'fancy footwork' for the rewrite rules :)
Edit: actually, it looks like this doesn't work the way I think it does ... looks like nginx has changed enough between 0.7 and 1.0 that my original config doesn't work as correctly as it used to. Edit 2: Actually I think WP Supercache is the one that changed. Edit 3: This config looks more up-to-date than mine -- http://rtcamp.com/tutorials/nginx-wordpressmultisite-subdoma... I particularly liked how they used the t…
Here's a list of "pitfalls" that are commonly used and really shouldn't: http://wiki.nginx.org/Pitfalls
I notice that you're using a lot of "if" statements. I hope you've read this http://wiki.nginx.org/IfIsEvil. I understand that in this case it might be harder to find alternatives for the if-statement, haven't looked into what you need really deeply.
Re: Wordpress.com serves 70k requests/second using Nginx
#78We dropped nginx because of no native support for session affinity. SSL support has been introduced in HAProxy very recently.
Re: Wordpress.com serves 70k requests/second using Nginx
#79We dropped nginx because of no native support for session affinity. SSL support has been introduced in HAProxy very recently.
Re: Wordpress.com serves 70k requests/second using Nginx
#80Earlier quoted context omitted.
I'm interested to hear what versions of PHP and APC you used. In my experience, stable APC releases have been very stable, but beta APC can poop out pretty bad, even if the changelog doesn't indicate anything that might affect your application. I've used stable APC + PHP + Apache releases to do some large things, so not sure why APC is an utter bomb in 2012.
We're talking ... late 2007 here. I must confess that I didn't keep an engineering diary.
My gut feeling tells me that your profiling is correct, however - any significant PHP application (that isn't written terribly inefficiently) will have its bottleneck in data access and not the parse/compile stage. There's very little point to speeding up by 250% a portion of your app that only accounts for 2% of execution time!