Choosing a Webserver

So many times, people choose to run WordPress on a traditional LAMP stack...STOP IT! Just because something is an industry standard, doesn't mean it's good. Yes, LAMP is a good stack sometimes, but not always. That's the important thing to know: when to use it, and when to use another stack.

For the time being, I'm going to focus on "A" and leave L,M, and P out of this.

In LAMP, A is Apache, one of the old and most popular web server applications on the Internet. Apache is great and serves up a lot of websites all over the web, but you want see any of the top 10 websites using it. WordPress.com doesn't even use Apache! I used Apache for a long time, but have since moved away due to performance issues. No hard feelings though! I still use it in some places!

What most people don't know is that Apache is relatively bloated these days and doesn't use RAM/CPU in the most efficient manner possible. It's not Apache's fault, it's just the result of being in existence since 1995 (Yes, I'm implying that's old).

I won't go over the installation/setup (in this post) as each one is very different from the other, but here are a few alternatives to consider before going with Apache:

NGINX:

NGINX™ is an advanced Internet infrastructure software. It is a high performance web server with the lowest memory footprint and it provides complete combination of the most essential features required to build modern and efficient web infrastructure. Today NGINX is the 2nd most popular open source web server on the Internet. NGINX functionality includes HTTP web server, HTTP and SMTP/IMAP/POP3 reverse proxy, content caching, load balancing, compression, bandwidth policing, connection multiplexing and reuse, SSL offload and media streaming.

LIGHTTPD:

Security, speed, compliance, and flexibility -- all of these describe lighttpd (pron. lighty) which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.

Litespeed:

LiteSpeed Web Server is the leading high-performance, high-scalability web server. It is completely Apache interchangeable so LiteSpeed Web Server can quickly replace a major bottleneck in your existing web delivery platform. With its comprehensive range of features and easy-to-use web administration console, LiteSpeed Web Server can help you conquer the challenges of deploying an effective web serving architecture.

See? There are other options out there. Ironically, each one clames to be the best.

Go ahead, step out of your comfort zone and use something other than Apache this time. You can do it!

I'll talk about what I use and why in an upcoming post...I might even go over how to install it...in fact, I will! I'll even cover installation and configuration of Apache, NGINX, and Lighttpd...with juicy sample config files to make your hearts melt. Stay tuned for those.

Categories, Monetization, and More...

I've been doing a lot of thinking about this blog, what it means to me, where I want it to go, and all the other stuff that comes along with thinking about blogs. Thanks to the extraction of my wisdom teeth (all four!) this week, I've finally gotten a chance to think about what I want to do with this piece of virtual property. I've re-arranged my categories (using some great advice), got some great post ideas in mind, added some monetization strategies, and been investing even more time in scaling the site to meet the demands I'm hoping for. (Yes, that's going to be a post!)

The hardest thing was pruning and merging categories. It's something a lot of bloggers don't do and they end up with 1,000 categories with 1 post in each. That's not good for anything...especially sanity and SEO! Since I'm going to be focusing this blog largely on WordPress, Blogging, and WordPress Performance, I had to make my categories matched that. Here's what I came up with:

Each category is pretty self explanatory, I think. Expect to see the most in Performance and WordPress! Web is going to be used as my play category where I post things that don't always pertain to WordPress, Performance, or even Blogging, but still want to share!

My monetization efforts have always been minimal and not visually assaulting. I do it on purpose. Now, rather than seeing the same ads on every page, the ads change on the post pages and a few of my other static pages (Archives, Sitemap, etc.). This is to present you with ads that are strategically related to the post...in other words, you won't be seeing cupcake ads on posts about WordPress (the algorithm isn't perfect, so you might see a few mismatches)!

The search bar is always present in case you wish to search the blog for another article!

I've been working really hard on ideas to move this blog forward.

Hold on tight.

Expect awesome.

Testing with Blitz

Since I'm always seeking to increase speed, I always need new tools to test everything. I use Pingdom Tools and Google Page Speed (GPS) on an almost daily basis. Though those sites are great for testing load speed, I needed something else tested: capacity. Pingdom Tools and GPS only simulate one user at a time, and while it's nice, it's not always practical. There's always a chance that more than one person will be accessing your page at a time.

Meet Blitz.

Blitz doesn't just simulate one user. Blitz uses two tests to help you determine how your server or application will do under any type of load.

The first step is called Sprinting. Sprinting runs a simple test from any of Blitz's regions around the world and shows you response time.

If the Sprint completes successfully (and it should under most circumstances) you move on to Rushing. Rushing is the real load test.

You can define the number of users and time using Blitz's command line syntax.

After you Rush, Blitz will show how you did. It's a great way to see where you need to improve. Here's a look at my Sprint and Rush.

[caption id="attachment_1219" align="alignleft" width="620" caption="Sprint Success!"][/caption]

[caption id="attachment_1235" align="alignleft" width="620" caption="Rush Success!"][/caption]

[caption id="attachment_1224" align="alignleft" width="620" caption="Rush Results!"][/caption]

It looks like I can withstand a lot of traffic before having to worry!

Blitz is an awesome tool! I've been using it to monitor An Altered Reality's performance over the past week. So far, it's been incredibly helpful helping me tweak my setup to get the best possible results...and it was better than my prior approach (that actually got some attention!) Give it a shot!

What do your results look like?

Writing a WordPress Plugin

I wrote a plugin for WordPress!

It's one of the most challenging yet most fulfilling things I've done and my only real contribution to WordPress (and calling it that is a stretch!).

I'm not a developer nor do I think like one all the time. The first language I was taught was Java. I was scared of it but we managed ok and I ended up with a strong B in the class.

Recently I was doing some work with a friend and it hit me: I needed to learn a language, any language. I'm fluent in SQL and HTML (but HTML isn't really a language; it's markup), but that wasn't going to help me. I picked PHP. It's an object oriented scripting language...that, I'm sure you knew. It's similar to Java as well as C, C++, and other OOP languages. Pieces began to click and I began writing forms with PHP and HTML. One thing led to another and I wanted to take a shot at a plugin. I picked something kind of simple. I wanted to add Open Graph Meta data to my header.

I was aware there were other plugins, but I didn't care. I thought they were all stupidly written with bloated code that frankly didn't make a damn bit of sense. Seriously.

Because my plugin is simply written and a simple concept, its appropriately named Simple OpenGraph.

[caption id="attachment_1081" align="aligncenter" width="539" caption="Open Graph Goodness!"][/caption]

So I found a few tutorials for guidance and went at it. A few hours later, version 0.1 was done and was mostly working! It had kinks but I got it figured out.

Now, a little over a month later, it's up to version 2.1 (I version fast) and in the WordPress plugin directory. It's a great feeling and to know that others (600 something) are using my plugin feels even better.

I'd challenge anyone to do it whether you've ever developed before or not. You wont regret it.

You can see the full plugin details as well as report bugs and submit feature requests on the official page.

Caching: Memory or Disk

[caption id="attachment_1008" align="alignright" width="270" caption="Caching Removes Weight!"][/caption]

Choices, Choices.

A small disclaimer: I'm going to assume you have a caching plugin installed at this point and you're wanting to know if you should choose disk based caching or memory based caching. I'm also going to assume that you don't have rockstar command line skills and that servers really aren't your thing...so I won't be giving you anything to put in a command line nor will I dive deep into hardware configuration. Nothing too deep.

Caching is a huge deal. All the popular sites do it, and the reasoning behind it is simple: it increases page load time and decreases server load. The less load, the more servers can serve content ultimately leading to fewer physical machines and lower operating costs (sometimes). It's a good thing, really.

If you're using shared hosting, caching is a must.

Disk Caching

At first, I was clueless. Disk (Advanced) appeared good the first time I installed W3 Total Cache (W3TC). I didn't think about the difference in hardware at the moment nor was memory caching an option. It just didn't seem relevant. I don't know why...hardware is half of my real job.

Disk caching has its pros and cons:

Pros:

  • Works on all types of hosting, shared and private
  • Increases page speed enough for some
  • Lightens the load on the server application (Apache and the like)

Cons:

  • Disk caching is caching files on a hard drive; the slowest part of a computer. Server drives aren't solid state either, those drives spin.
  • Increased drive I/O isn't the best thing in the world (Drives fail. Not if, when.)
  • Isn't incredibly fast

Disk caching is the easiest caching and for the inexperienced user, probably the best option. It requires almost zero configuration. It's a set and forget method, and it's fast enough for most people. The biggest downside is that it's caching on the disk. Hard drives, even the 15K (that's fancy talk for 15,000 RPM) drives in my NAS servers, are the slowest part of a computer.

Memory Caching

Memory caching (mem caching) works slightly different. Programs like APC and Memcached cache in memory rather than on the disk. Memory is fast. Very fast. When you remove moving parts from the equation, everything speeds up. Your data never has to leave the motherboard, travel down some cable, hit a controller, wait to be written...you get it? Though mem caching is better, it's not perfect either.

Pros:

  • Faster than disk caching
  • Significant page speed increase if configured properly
  • More efficient on hardware (no moving parts; RAM lasts longer than hard drives)

Cons:

  • Not easy to configure
  • Requires some maintenance
  • Can consume large quantities of memory causing your site to time out

Though the biggest plus is page speed increase, the biggest con is that successful mem caching requires a good bit of RAM, or some seriously modified configuration files. If you don't have the RAM, and you attempt to use something like APC or Memcached, you might find your server unresponsive. It's not fun, and not easy to fix.

Conclusion

Caching, memory or disk, is crucial to site performance. If you don't cache, you risk slow page load times which ultimately affect SEO as well as your pageviews. People aren't patient, and I promise, our content is no exception.

Good luck! If you have any questions, hit the comments.

Good Hardware

[caption id="attachment_717" align="alignright" width="358" caption="That's Good Hardware!"][/caption]

[This is Part of the Series: Making WordPress Fast]

For the majority of bloggers, hardware isn't really a factor thanks to shared hosting. With shared hosting, you get good hardware at a relatively low cost; you just have to share it with God only knows how many other people. That's annoying.

Some bloggers prefer total control over everything, including hardware.

Unless you own your own server, you'll probably be looking at virtual private hosting. If you sign up for VPS hosting, you get your own virtual server (running some flavor of Linux)and usually get full root access (that's full admin access) to it. VPS hosting allows you to control the amount of RAM you get, the number of virtual CPUs, and the amount of disk space you want.

For the non-technical beginner, that's a lot to think about! Most people don't know how much RAM they need, especially on a Linux system, and know nothing about the number of CPUs that they need.

Allow me to break it down for you.

Linux doesn't necessarily need the same amount of RAM you have in your laptop. You don't have to have several gigabytes. You can get by with as little as 300mb and be fine! This is due to the fact that Linux was designed to be run on almost anything, and the AMP part (Apache, MySQL, and PHP) of the LAMP (Linux, Apache, MySQL, and PHP) stack doesn't use a ton of resources! The more viewers you have though, the more resources Apache will use. Keep that in mind when making your selections!

In terms of virtual processors. Two are great...but not necessary. One is sufficient. Linux rarely consumes 100% of the CPU...heck, my linux installations rarely even consume 15%, and they do a lot more than the average!

Disk space is really up to the user. Linux only requires somewhere between 1 and 3 GB for itself, so 10Gb of disk space is a great place to start.

Small Blogs:

A small blog that only gets a small amount of traffic should be similar to this:

300mb RAM

1 Virtual CPU

10GB Disk space

Medium Blogs:

A medium sized blog, with relative traffic should  have something like this:

512mb - 1Gb RAM

1 virtual CPU

25 Gb Disk

Large Blogs (or a blog network):

A large blog with a lot of traffic should look something like this:

2-4GB RAM

2 virtual CPUs

and 50-100GB Disk space

...those are some guidelines. I hope they help!

I user the free tier of Amazon AWS, so my specs look like this:

613 MB RAM (I wish I knew how Amazon came up with that!)

1-2 virtual CPUs (they burst when necessary)

10 GB disk space (which I dont really need! I use S3 for all of my content delivery! More on that later!)

...Though I love my setup, I would not recommend it to everyone! It takes a lot of work to get it setup and then some residual work to keep it that way. Additionally, I'm responsible for all updates, security patches, and my own down time! If I'm down, it's usually my fault!

Other Considerations:

In addition to hardware configurations, here's some other things to consider when making the move from shared to private hosting:

Take into consideration your provider, their Service Level Agreement, and uptime percentage/guarantee.

You need a reputable provider. Don't just hunt for the best deal! It will only bite you later. You often get what you pay for online. I'd suggest Dreamhost or Media Temple!

SLAs are very important. It will state the level of service you can expect from tech support if you ever need to contact them! Trust me, if you think you're going to need a lot of help, they need a good one!

You also want a good uptime guarantee. Some providers state 99.99% others 99.95% and others are even as brave as 99.999%! It needs to be high. You don't want anyone with a low or unstated uptime promise.

Do you use private or shared hosting? If private, what do your settings look like? Let's talk in the comments!

*Note: All of the recommended hardware settings assume you use WordPress in a LAMP environment.