Hawk Wings gets leaner and meaner
This morning I got a polite but firm email from my web host.
Hawk Wings, it said, needs optimisation:
Your site attracts a lot of visitors which translates to a lot of hits and bandwidth (we’re talking about 100K hits yesterday, and 18 GB of bandwidth used in April). To compare: … In the past four days, your site has spawned almost *two times more* PHP processes than the next nine users combined, on the server. Also, your site used *four times more* time spent in running MySQL queries than then the next nine users combined.
Obviously that’s a nice problem for me to have, but not so nice for the other sites on the shared server.
I teach Ancient Greek in my day job, a skill of limited use when it comes to blog optimisation.
Luckily, Hawk Wings reader and professional web site designer Brady J Frey knew exactly what to do. He whipped through the code and without making too many rude remarks, cleaned it up and made it much more efficient.
It feels faster and leaner to me. I hope it will to TextDrive too. If not, things like the Recent Posts list and the tag cloud will start disappearing off the front page.
Personally, I can’t thank or recommend Brady highly enough. He was fantastic. The professional services that his design company dotfive
offers are sure to be even better.
Related posts

April 26th, 2006 at 9:45 pm
I’ve really been enjoying your site for some time now … I am also running WordPress and my space seems to be hitting a performance wall … I know it isn’t your area, but do you think you or Brady could let us know what he did to optimise the code? Keep up the good work!
April 26th, 2006 at 10:29 pm
Hmmmm….
Brady might not want to embarrass me by describing all the gory details of my shonky coding…. Or, then again, he might :)
April 26th, 2006 at 10:54 pm
I’ve never heard of Wordpress using to much bandwidth. But any tips would be great. :) I optimize blogs all day long and any tips and tricks would be wonderful.
April 26th, 2006 at 11:55 pm
From what I remember, WordPress is a collection of PHP scripts. There are a number of ways you can optimize the runtime of PHP scripts depending on what extensions are built into the server. A good start is making sure the scripts are being run with mod_php, which allows the web server to keep pre-loaded PHP files always in memory rather than having to parse them from disk every time. Outside of that, if you have access to Zend technologies on your server:
http://www.zend.com/
You can effectively compile (using an optimizing compiler, which cleans up your code for you) your PHP scripts, which can greatly increase their performance.
All of that being said, it’s pretty lame that a web presence provider would send that note. It’s one thing if you’ve purchased an account of type A and you’re pulling traffic and server access that fits a more expensive type B. However, in this case the load appears to be beyond anything the provider ever planned to provide! I think this should be a hint that the provider needs to grow a little bit. After all, Hawk Wings is a popular site, sure, but I’m sure there are other sites out there that get far more traffic, and this provider clearly isn’t ready for them. (on top of that, I’m guessing HawkWings is running standard WordPress code with some plugins… it’s not like it’s some custom scripted code that periodically sucks up all of the processing time on the system)
What I’m getting at is that they’ve guilted Hawk Wings into making some changes while I think they really should be embarassed to admit that they have reached their own capacity.
April 27th, 2006 at 12:16 am
Hmm - CPU usage must be in the air. I just got a message from my ISP along the same lines. I have yet to determine what is causing the excessive CPU use, but it might be due to the ISP by default running php as CGI instead of as mod_php.
April 27th, 2006 at 12:31 am
If you’re the guy who’s been crashing barclay over at TextDrive these last few months, I shake my virtual finger at you. :)
For what it’s worth, I run sites in both Wordpress and Movable Type, and in your case, MT would definitely be better — flat static files, no need for database calls for every last visitor, and your rebuilds would still be reasonable.
April 27th, 2006 at 12:31 am
Daniel wrote:
Is that what “FastCGI” is?
April 27th, 2006 at 12:33 am
No, I’m not on Barclay, but I do feel for them, seeing the “Barclay’s choked (again)” notes coming through on the RSS feed. :(
MT, eh? And I’ve only just worked out WordPress after nine months of trying :(
April 27th, 2006 at 12:52 am
No, FastCGI is not the same as mod_php (or mod_perl), but it’s very similar.
FastCGI works the same way as mod_php, and it increases performance of the scripts for the same reasons as mod_php. However, FastCGI is not built into the web server. mod_php is. mod_php is a module for an Apache web server.
There are advantages to using FastCGI over mod_php. Years ago it was popular to build all of your optimizers/extensions right into the web server. You could find Apache modules for everything. Now we see lots of things that run in parallel with the web server. (Zope is popular, and a popular was of using it is to run it separate from the web server) As usual, there are tradeoffs to both ways, and lately people have been shifting back to the parallel-with-the-server methods. This is a big reason why FastCGI is being talked about again.
(so if your scripts are running on FastCGI now, then that’s “equivalent” in some ways of being loaded by mod_php… yet not technically the same)
April 27th, 2006 at 12:58 am
It turns out that Wikipedia has a pretty decent little FastCGI explanation and history:
http://en.wikipedia.org/wiki/FastCGI
They bring up the good point that as these “in-parallel-with-the-server” technologies become popular, “leaner and meaner” web servers are starting to enter the market. (like Lighttpd)
April 27th, 2006 at 1:08 am
Thanks for the link, Ted. I should have thought to look there first. I’ll read up on it.
April 27th, 2006 at 1:47 am
no MT please:)
While we can argue MT does more static files by default — we can do static pages in Wordpress too — in fact, you can do much more than just simply running a blog — by defintion, all of our sites to date (with the exception of the ones that require more mid to large scale business, of which we go Joomla, and looking at Django or Matrix or a Ruby on Rails solution in the future for other stuff) run on wordpress for both static and dynamic content, making it more like a content management system than simply a blog package. Our new site will be coming with our more recent designs, we’re even running a few stores on WP, which should be launching at http://delightfulhealth.com in the next 48 hours — an example of a smaller soley wordpress driven site we did is http://www.bentlyholdings.com — completely recustomized admin section as well.
Moveable Type is a quality system — just like I dig textpattern for it’s tagging system — but wordpress (and textpattern is similar) affords me the right to rip it apart and put it back together again like the loving open source application it was meant to be:)
I’ve had this happen before with providers — even had it with Dreamhost from friends before — needless to say Hawk Wings is starting to pick up in readership. Even though it’s file capacity is just as small as the normal sites, it’s database driven website and accessive readership is eating away bandwidth — more so than most of their hosted sites on the shared server. I’m sure it’s in their shared server disclaimer to note, but most don’t get this very happy problem. Usually this means:
1) Cut down the extra code if it’s not needed and optimize what you have. Wordpress does some silly calls in it’s comments to dynamically show how quick the server reaction is, the Kubrick theme (which this is based off) adds some other server calls that can be uncommented to teach users what other parts of the wordpress ‘Loop’ you can use to display information. Needless to say, all that cruft was removed promptly, any accessive coding was stripped out, and much was optimized to simply be smaller. Even a quick small trick like making your CSS single lined: http://www.hawkwings.net/wp-content/themes/default/style.css
Which annoys people to know end except me and dotfive employees now (I think it’s easier to read when all the statements are on one line), but it took off almost 5kb of information by simplay changing from the old double/triple line to single line. I can’t call all the PHP loop commands in this comment that Wordpress adds for no reason, but I promptly removed them. Needless to say all those calls + downloading of stylesheets multiplied by 100,000+ a day seemed a burden. If it does continue even further, I maybe inclined to custom design this guy with fully semantic, standard, and custom code - if fact, I may want to do that pro bono someday if you let me go to town on it Tim;)
2) Go to a different host. Not all hosts suffer from this on a shared hosting level - in fact, I agree with Ted, it’s an embarrassment to textdrive in some sense and shows their own weakness (yes Textdrive, I run my own servers - albeit OS X tiger servers and only 300+ users and websites for businesses that we work with). Upgrading to a dedicated host just for bandwidth is slightly overkill.
Dreamhost runs their PHP as fastCGI, I did not go into his server management system to verify, but mod_php IS running just fine on it.
Thanks for the plug Tim, I’m happy to help anytime:)
As a notice, if anyone wants to talk specifically about wordpress optimizing/hacking, you can always email me at brady at dotfive.com, happy to swap knowledge and share tips;) sometimes I post them on http://pulltoinflate.com/ but I’m so busy designing, my writing has been limited as of late:(
April 27th, 2006 at 4:32 am
Ironically, Subtraction just spoke out about Wordpress vs Moveable type as well, read his take:
http://www.subtraction.com/archives/2006/0425_the_movable_.php
April 27th, 2006 at 12:37 pm
That’s really interesting to me. Modern web servers and web browsers should automatically be gzipping outoging streams and gunzipping incoming streams without too much computational load at either end. This, I think, should reduce the bandwidth required to send the CSS the same amount as making it a single line.
Are the gains from stripping out the whitespace yourself really that much better? Or does gzipping not happen as much as I think?
April 28th, 2006 at 6:24 am
I use ExpressionEngine. It makes good use of caching with queries, templates, and tags.
April 28th, 2006 at 1:57 pm
I find it’s not happening that often — and it depends on the server setup. You can also specify NOT to do such things, which I started noticing recently in this blog and recommended enabling it in wordpress (you can have it’s management system judge and deliver pages gzipped as needed). I’m not so sure if with a large amount of shared users that this could be such a burden that it’s turned off maybe? regardless, any little bit of saved bytes will help.
It looks like I need to purchase licenses? What makes it better than Wordpress that’s free?