JuanJose Galvez
GimmeSoda.com Server Move: XCache, W3-Total-Cache and Nginx = Awesome
2I’ve moved this site (gimmesoda.com) over to a test server (Private Server) I’ve got running on DreamHost. This server is running Nginx instead of Apache, both machines (the PS it was running on before, and the PS it is now running on) are set to 2GB of memory and the software setup of WordPress is exactly the same.
Why:
Apache can be a memory hog.
As more and more traffic comes into a website the Apache process continues to spawn memory hogging worker processes and during my basic testing I saw over 90 apache worker processes spawned at one time. Each of those processes were taking about 23MB worth of memory when spawned (23 x 90 = 2070MB) which maxed out the $100/month PS machine and returned several hundred errors at 100 concurrent connections.
Nginx handles concurrency much better and requires far less memory.
When the site was moved over to Nginx I ran the same test (1000 requests with 100 concurrency) and memory usage was under 800MB, it also returned 0 errors compared to the 664 from the use of Apache. Also, you should take note of the speed between the two in the results below, Nginx returned all requests in under 1s.
WordPress Cache Settings:
I’ve switched off the use of WP-SuperCache, which uses disk based caching and provides no further options such as opcode caching (APC/XCache/eAccelerator) which W3-Total-Cache does provide! Not only does it provide a static page cache as well as opcode options but it incorporates minify options, database, and object caching among other features.
All cache options have been set to XCache rather then disk, after all reading from memory is faster then reading from disk.
The Setup:
- WordPress v3.0.1
- Theme
- I am using the Mystique theme, which thankfully does NOT use the timthumb.php script (I am NOT a fan of it).
- Plugins
- Akismet
- All in One SEO Pack
- Categories to Tags Converter Importer
- Clean-Contact
- Dragon Design Sitemap Generator
- DreamHost WordPress Backup
- FeedBurner FeedSmith
- Google XML Sitemaps
- Paypal Donate Plugin for WordPress Widget Support
- Permalinks Moved Permanently
- Piwiks Analytics
- Twitter for WordPress
- W3-Total-Cache
- WordPress.com Stats
- WordPress Importer
- WP-FLV
- WP-PayPalDonate
- Theme
AB (ApacheBench) Results:
| Apache Results | Nginx Results |
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.gimmesoda.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache
Server Hostname: www.gimmesoda.com
Server Port: 80
Document Path: /
Document Length: 30876 bytes
Concurrency Level: 100
Time taken for tests: 6.912 seconds
Complete requests: 1000
Failed requests: 664
(Connect: 0, Receive: 0, Length: 664, Exceptions: 0)
Write errors: 0
Non-2xx responses: 664
Total transferred: 10878952 bytes
HTML transferred: 10588808 bytes
Requests per second: 144.67 [#/sec] (mean)
Time per request: 691.234 [ms] (mean)
Time per request: 6.912 [ms] (mean, across all concurrent requests)
Transfer rate: 1536.96 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 15 164.4 7 3013
Processing: 24 511 782.2 190 4087
Waiting: 17 503 778.0 188 4074
Total: 46 526 792.6 196 4091
Percentage of the requests served within a certain time (ms)
50% 196
66% 266
75% 499
80% 744
90% 2018
95% 2703
98% 2983
99% 3060
100% 4091 (longest request)
|
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.gimmesoda.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: nginx/0.7.65
Server Hostname: www.gimmesoda.com
Server Port: 80
Document Path: /
Document Length: 30874 bytes
Concurrency Level: 100
Time taken for tests: 3.158373 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 31348328 bytes
HTML transferred: 30961170 bytes
Requests per second: 316.62 [#/sec] (mean)
Time per request: 315.837 [ms] (mean)
Time per request: 3.158 [ms] (mean, across all concurrent requests)
Transfer rate: 9692.65 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 22 11.8 20 63
Processing: 36 184 108.6 144 874
Waiting: 8 34 24.6 26 279
Total: 37 206 111.5 166 913
Percentage of the requests served within a certain time (ms)
50% 166
66% 209
75% 251
80% 273
90% 347
95% 405
98% 569
99% 641
100% 913 (longest request)
|
More Information
Nginx: A web server written to address the C10K problem. http://wiki.nginx.org/Main
XCache: A fast opcode cacher, it’s a PHP extension. http://xcache.lighttpd.net/
W3-Total-Cache: A brilliant (and free) wordpress caching plugin that goes the extra mile. http://wordpress.org/extend/plugins/w3-total-cache/
Wedding Rosary Site
0We’ve finally gotten to the point where I’m happy to be pushing traffic to my wife’s new site. She makes rosaries for weddings and special occasions as well as some jewelry, we’ve been selling them for awhile now but didn’t have a nice site for it up till now.
http://www.myweddingrosary.com/
MyWeddingRosary.com is built using the Magento eCommerce platform, it’s integrated with Google Checkout and PayPal for payment processing. Piwik and Google Analytics (with conversion tracking) are both in use, since I like my stats! We’ve also got all products linked into the Google Base.
Advertising is now running for this site and I’m keeping a careful eye on the conversion ratio for both sales and leads. Wish us luck!
Quick Note on Meteor Server Permissions
0You don’t need root to run Meteor Server, it can be setup to run under a single user without sudo. If you are running it on the same machine as the website it is serving you also don’t need to run it on anything other then the default port and you’ll still avoid cross site scripting errors.
Good times!
Just a thought…
0It’s been a long while since I’ve done any serious amount of writing, I think I’m going to go ahead and give it a shot and see how it goes. At the very least my wife would like it!
New Site: 10DollarBluRay.com
1Working on a new affiliate marketing project, http://www.10dollarbluray.com/
The purpose of this site is to locate low cost blu ray movies on Amazon, ordered by purchase rank. I obviously need to proper design and I’m working on adding a few extra features (search and a site map). Anyhow, take a look, feel free to let me know if you have ideas or questions!
Playlist AWESOME
3You HIMYM fans will recognize this. Some of the songs have been cut to decrease any potential for loss in tremors of psychitude.
1) You Give Love a Bad Name – Bon Jovi
2) The Humpty Dance – Digital Underground
3) Come Sail Away – Styx
4) Don’t Stop Believin’ – Journey
5) The Transformers Theme – Vince DiCola
6) You’re The Best Around – Joe Esposito
7) High Enough – Damn Yankees
8) Jessie’s Girl – Rick Springfield
9) Rock You Like A Hurricane – Scorpions
10) Hip Hop Hooray – Naughty By Nature
11) Change Of Heart – Tom Petty
12) Run Runaway – Slade
I’m worried now – we NEED more songs. Working on it….
Songs to add in:
I Wanna Rock – Twisted Sister ???
Paradise City – Guns N’ Roses *fist bump*
Lick It Up – KISS
Talk Dirty To Me – Poison
In the mood for tequila…
0Okay so I’m normally in the mood for some good tequila however, tonight/this morning, I’ve really been craving two very specific bottles, however I wouldn’t mind some of the third about now.
First we have La Pinta Pomegranate Tequila, which I’ve been craving for awhile but have been too lazy to go pick up or order.
The next is Tres Generaciones Anejo, which anyone who has been introduced to tequila by me has very likely had a taste of. It’s among my favorites and goes down smoothly even for those people who aren’t big on tequila.
I’ve only had this one twice Milagro Select Anejo tequila, super smooth tequila that’s just a little sweeter then most anejo’s I’ve tasted. Wonderful, a great tequila for special occasions, or the nights you want to get messed up – with class.
As my buddy Sambeano would say, “Goulet!”
Now, if you happen to feel like being REALLY REALLY kind to me and want to feed my habit, you could always send a bottle of Herradura Tequila Seleccion Suprema my way, I promise it won’t impede my programming for tooo long. I probably wouldn’t open it until I finish up with WhereToHost.net and get a few extra patches/additions out for my installer framework.
Where To Host
1I’ve been pushing forward on a personal project over the last two weeks or so, it’s called WhereToHost and I think it’s brillant. If you’ve heard me talk about it, you already know this, but what you may not know is that the initial beta system is ALMOST ready! I need some help though, would you mind?
Lots of my readers here are webmasters and programmers, you’ve encountered many different systems, scripts, and apps that you like working with. So here is what I need to know and how you can help me….
What PHP apps are your favorites? What scripts are so important that, you believe, this new site of mine wouldn’t be complete without?
Let me know in the comments and I’ll add the systems as they come in! Oh and if you get a chance you should read about my somwhat difficult choice, over on the news blog to the new site.




Top Commenters